Merge pull request #1697 from Safelite/feature/debugLoop

Feature/debug loop
This commit is contained in:
CarlNation 2024-01-19 11:21:27 -05:00 committed by GitHub
commit e90dd96483
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 20 deletions

View file

@ -30,10 +30,7 @@ export function isAnalyticsSessionStillActive() {
export function isSavedSessionStillActive() {
if (getFunnelCookie() !== null) {
const savedSessionTimeStamp = new Date(getFunnelCookie().SavedSessionTimeoutDate);
console.log("savedSessionTimeStamp " + savedSessionTimeStamp);
const isSavedSessionTimedOut = new Date(new Date().toUTCString()) > savedSessionTimeStamp;
console.log("utc date " + new Date(new Date().toUTCString()));
console.log("isSavedSessionTimedOut " + isSavedSessionTimedOut);
return !isSavedSessionTimedOut;
}

View file

@ -40,7 +40,6 @@ const routes = [
async beforeEnter(to, from, next) {
// If we have no query string, or we don't have the FmgPage query string.
try {
console.log("beforeEnter");
await analyticsMixin.methods.validateSession();
if (getFunnelCookie()?.SuppressConceptFunnel) {
@ -63,7 +62,6 @@ const routes = [
}
// On entering the funnel "fresh", read cookie information, decide what to do next.
else if (from.redirectedFrom === undefined) {
console.log("redirectFrom is undefined");
// clear the saveSessionPromise - if it exists in the vuex store but a new instance was created
// the saveSessionPromise will no longer point to a valid promise
baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
@ -71,7 +69,6 @@ const routes = [
if (!to.query.fmgPage.startsWith("payment")) {
//payment pages used to return from safelitehop so exclude here
// Remove the parameter after quote release
console.log("calling load session");
const loadSessionResponse = await loadSessionIfPresent(
to.query.isInsurance != null
? to.query.isInsurance == "true"
@ -82,13 +79,12 @@ const routes = [
);
const pageToRedirectTo = await getPageToRouteExistingOrderTo(to);
console.log("load session complete...redirect to " + pageToRedirectTo);
// Assign our fmgPage so it will load normally like the other pages.
to.query.fmgPage = pageToRedirectTo;
}
}
console.log("router run experiments");
await runExperiments(to.query.fmgPage);
// Process funnel cookie.
@ -96,7 +92,6 @@ const routes = [
// If we already have our route, go to it.
if (router.hasRoute(to.query.fmgPage)) {
console.log("has to page " + to.query.fmgPage);
// Since our route is already in scope, we can grab the component from it and call the arePagePrerequisitesValid function.
let component = router
.getRoutes()
@ -108,7 +103,6 @@ const routes = [
}
if (!arePagePrerequisitesValid(component)) {
console.log("go to start 404");
GoToFunnelStartOn404(next);
}
@ -140,8 +134,6 @@ const routes = [
GoToFunnelStartOn404(next);
}
console.log("next " + routeData[0].name + " ");
// Assign current query string parameters, as well as our fmgPage one.
next({
name: routeData[0].name,
@ -152,7 +144,6 @@ const routes = [
console.log(error);
if (to.query?.fmgPage === funnelStartPageName) {
console.log("router catch error");
deleteFunnelCookie();
await baseMixin.methods.dispatchStoreAction(storeActions.RESET_STATE);
}

View file

@ -1744,10 +1744,6 @@ export const actions = {
) {
const order = context.state.order;
console.log(
"store load session " + savedSessionId + " " + referralNumber + " " + referralDate
);
return globalMethods
.callHttpClient({
method: endpoints.LoadSession.method,
@ -1773,8 +1769,6 @@ export const actions = {
return glass;
});
console.log("load session success " + JSON.stringify(response.data));
// clear the state if the existing EON does not equal what is returned from loadSession
if (context.state.order.eon && context.state.order.eon != response.data.eon) {
context.commit(storeMutations.RESET_STATE);
@ -1789,7 +1783,6 @@ export const actions = {
return response;
},
(error) => {
console.log("load session error " + JSON.stringify(error));
deleteFunnelCookie();
context.commit(storeMutations.RESET_STATE);
}