Files
m8chat-app2/lib/core
help4bisandClaude Sonnet 5 7c9e730cf0 fix(analytics): resolve sessionId before assigning trackScreen state (v1.12.1+17)
The sessionId getter mints a fresh session on cold start or after a
30-min lapse, and as a side effect nulls _currentScreenName/_currentStepUid.
trackScreen() set those fields before calling the sessionId getter, so the
mint-on-cold-start side effect could immediately null the fields it had
just set, breaking the same-screen idempotency check and firing a
duplicate session_enter right after cold start.

Fix: resolve visitorId and sessionId into local variables before
assigning _currentScreenName/_currentStepUid, and use the locals in the
_enqueue() payload.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 14:58:56 +10:00
..