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>
This commit is contained in:
2026-09-25 14:58:56 +10:00
co-authored by Claude Sonnet 5
parent 729822c97e
commit 7c9e730cf0
2 changed files with 21 additions and 4 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
name: m8chat_app
description: "M8Chat — Matrix chat client for Android, iOS, and Web."
publish_to: 'none'
version: 1.12.0+16
version: 1.12.1+17
environment:
sdk: '>=3.11.0 <4.0.0'