Fix tabId being lost due to initialization-order issue with the client bundle #9182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduced in: #9134
We inject a script tag into the page that sets
tabId
onwindow
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 fromdefer
toasync
, which changed the execution order, and we started getting analytics events withtabId
missing.A similar workaround to this was already applied for
publicSettings
, buttabId
was missed.Tested by: Putting a
console.log
inclient/logging.ts
that reportstabId
, observing that it wasundefined
, making the changes in this PR and rerunning the test, and getting a valuedtabId
at that point instead.┆Issue is synchronized with this Asana task by Unito