fix(analytics-browser): defer session_start until Context plugin is ready - #1825
Draft
stevenchien-amplitude wants to merge 1 commit into
Draft
fix(analytics-browser): defer session_start until Context plugin is ready#1825stevenchien-amplitude wants to merge 1 commit into
stevenchien-amplitude wants to merge 1 commit into
Conversation
…eady Move setSessionId() to after Destination and Context plugins are registered during init so session_start events are enriched with device_id and library. Fixes intermittent 400 ingestion errors reported in SR-4611. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Linear: SR-4611 — Investigate session replay plugin and
session_start400sFixes intermittent 400 ingestion errors where
session_startevents were missing bothuser_idanddevice_id(Pet Media app 628463).During
AmplitudeBrowser._init(),setSessionId()was called before the Context plugin was registered. Becausesuper._init()setsisReady = truefirst, session events could dispatch before Context enriched them withdevice_id,user_id, andlibrary— matching the bad payloads from DPL-258.This moves
setSessionId()to run afterDestination,Context, andIdentityEventSenderare installed.Checklist
Test plan
should enrich session_start during init with device_id and librarybrowser-clienttests pass locallyAI Prompt
Investigate SR-4611 (session replay plugin and session_start 400s), post findings on the ticket, and implement a fix for the SDK init race causing missing device_id on session_start events.