Merge pull request #1232 from Safelite/feature/jzimmerman/INSR-9777

Fixes for missing ClientTag value on session log.
This commit is contained in:
Jeremy-Z 2026-05-19 13:24:44 -04:00 committed by GitHub
commit 29237a4bf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 2 deletions

View file

@ -115,6 +115,8 @@ export default {
return { isAuthorized: false }; return { isAuthorized: false };
} }
this.mainStore.issConfig.clientTag = clientTag;
const resp = await validateISSClientTag(clientTag); const resp = await validateISSClientTag(clientTag);
if (!resp) { if (!resp) {
return { isAuthorized: false }; return { isAuthorized: false };

View file

@ -554,7 +554,13 @@ export default {
const sid = getSessionIdValue(); // cookieNames.SESSION_ID const sid = getSessionIdValue(); // cookieNames.SESSION_ID
// const skey = getSessionKeyValue(); // const skey = getSessionKeyValue();
const referrer = applicationConfig.CURRENT_ENVIRONMENT !== 'Localhost' ? document.referrer : null; const referrer = applicationConfig.CURRENT_ENVIRONMENT !== 'Localhost' ? document.referrer : null;
const store = useMainStore();
const clientTag = store.issConfig.clientTag;
const siteType = store.issConfig.siteType;
const payload = { const payload = {
clientTag,
deviceId, deviceId,
referrer, referrer,
sessionId: sid, sessionId: sid,

View file

@ -35,6 +35,19 @@ const routes = [
return await GoToAccessIsDenied(next); return await GoToAccessIsDenied(next);
} }
// This is a quick fix for a prod issue.... better fix will come later.
// This and experiment call for entry-page probably need to be called directly in the mounted
// secion of the entry-page. Can be here for every other page.
if (issPageToUse === issPageValues.ENTRY_PAGE )
{
const store = useMainStore();
const queryStringParams = parseQueryParms(to.query);
if (queryStringParams.clienttag) {
store.issConfig.clientTag = queryStringParams.clienttag;
}
}
await analyticsMixin.methods.validateSession(); await analyticsMixin.methods.validateSession();
// Do not run these for the main entry page - as it is not part of the user flow. // Do not run these for the main entry page - as it is not part of the user flow.
@ -436,6 +449,16 @@ function arePagePrerequisitesValid(component) {
return component.default.methods.arePagePrerequisitesValid === undefined || component.default.methods.arePagePrerequisitesValid(); return component.default.methods.arePagePrerequisitesValid === undefined || component.default.methods.arePagePrerequisitesValid();
} }
// TODO: Put this function some place common.
function parseQueryParms(queryString) {
// Dump the query string parameters into an object
if (queryString) {
return Object.fromEntries(Object.entries(queryString).map(([key, value]) => [key.toLowerCase(), value]));
}
return {};
}
// Run SiteEntry and PageEntry triggers for experiments // Run SiteEntry and PageEntry triggers for experiments
async function runExperiments(nextPage) { async function runExperiments(nextPage) {
const store = useMainStore(); const store = useMainStore();

View file

@ -254,6 +254,7 @@ export const getDefaultState = () => ({
clientDisplayName: 'Generic Insurance', // this is the default and will be overridden by the client's name or client display name. clientDisplayName: 'Generic Insurance', // this is the default and will be overridden by the client's name or client display name.
clientPossessiveName: 'Generic Insurance\'s', // this is the default and will be overridden by the client's name or client display name converted to possessive or the clients possessive name. clientPossessiveName: 'Generic Insurance\'s', // this is the default and will be overridden by the client's name or client display name converted to possessive or the clients possessive name.
clientHeader: {}, clientHeader: {},
clientTag: '', // ClientTag used by the client to enter the site.
styleSheet: '', // Stylesheet used by the client. styleSheet: '', // Stylesheet used by the client.
parentAccountNumber: 0, // Parent account number used by the client. parentAccountNumber: 0, // Parent account number used by the client.
billToAccountNumber: null, billToAccountNumber: null,
@ -269,7 +270,7 @@ export const getDefaultState = () => ({
policyZipCode: null, policyZipCode: null,
dateOfLoss: null dateOfLoss: null
}, },
siteType: null, siteType: null, // SiteType / SubType the site is set to (Essential/Advanced).
enableNoCompQuote: false enableNoCompQuote: false
} }
}); });
@ -2242,6 +2243,7 @@ export const useMainStore = defineStore({
this.issConfig.clientFullName = 'Generic Insurance'; this.issConfig.clientFullName = 'Generic Insurance';
this.issConfig.clientDisplayName = 'Generic Insurance'; this.issConfig.clientDisplayName = 'Generic Insurance';
this.issConfig.clientHeader = {}; this.issConfig.clientHeader = {};
this.issConfig.clientTag = '';
this.issConfig.parentAccountNumber = 0; this.issConfig.parentAccountNumber = 0;
this.issConfig.styleSheet = ''; this.issConfig.styleSheet = '';
this.issConfig.isCoverageEnabled = false; this.issConfig.isCoverageEnabled = false;
@ -2632,9 +2634,11 @@ export const useMainStore = defineStore({
this.logExperimentIfExists(issPage, experimentUniverses.ISS_FEATURETOGGLE_AREFEES_HIDDEN); this.logExperimentIfExists(issPage, experimentUniverses.ISS_FEATURETOGGLE_AREFEES_HIDDEN);
this.logExperimentIfExists(issPage, experimentUniverses.ISS_FEATURETOGGLE_AREFEES_OVERRIDDEN); this.logExperimentIfExists(issPage, experimentUniverses.ISS_FEATURETOGGLE_AREFEES_OVERRIDDEN);
}, },
async initializeSession({ userId, sessionId, userAgent, referrer }) { async initializeSession({ userId, clientTag, siteType, sessionId, userAgent, referrer }) {
//TODO: Add SubType passing ... that is also missing.
const payload = { const payload = {
applicationName: applicationConfig.APPLICATION_NAME, applicationName: applicationConfig.APPLICATION_NAME,
clientTag: clientTag,
userId, userId,
deviceId: userId, deviceId: userId,
sessionId, sessionId,