You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent event loss during initialization by setting isReady before onReady
Fixed a race condition where events tracked during the onReady() processing
were incorrectly categorized as pending and never sent to Segment.
The bug occurred when:
1. App starts tracking events before initialization
2. During init, onReady() begins processing pending events (takes seconds)
3. New events arrive while onReady() is still running
4. These events check isReady (still false) and get saved as "pending"
5. Since onReady() already ran, these new pending events are never processed
The fix simply swaps two lines to set isReady=true BEFORE calling onReady(),
ensuring any events that arrive during processing go directly to the queue.
Added tests to verify the initialization order and prevent regression.
0 commit comments