Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tabId being lost due to initialization-order issue with the client bundle #9182

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

jimrandomh
Copy link
Collaborator

@jimrandomh jimrandomh commented Apr 25, 2024

Introduced in: #9134

We inject a script tag into the page that sets tabId on window to a value that identifies the pageload, for analytics. That injected script tag needs to run before the client bundle does, or it will look for the tabId on initialization and it won't be there. The previous PR changed the client-bundle import from defer to async, which changed the execution order, and we started getting analytics events with tabId missing.

A similar workaround to this was already applied for publicSettings, but tabId was missed.

Tested by: Putting a console.log in client/logging.ts that reports tabId, observing that it was undefined, making the changes in this PR and rerunning the test, and getting a valued tabId at that point instead.

┆Issue is synchronized with this Asana task by Unito

@jimrandomh jimrandomh requested a review from a team as a code owner April 25, 2024 22:39
@jimrandomh jimrandomh requested review from oetherington and removed request for a team April 25, 2024 22:39
Copy link
Collaborator

@b0b3rt b0b3rt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jimrandomh jimrandomh merged commit 247ee6f into master Apr 25, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants