fix: only fire APP_OPENED on background → active transition#27463
fix: only fire APP_OPENED on background → active transition#27463vinnyhoward wants to merge 1 commit intomainfrom
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|



Description
When the QR scanner on iPhone prompts the user to grant camera access, iOS transitions the app to inactive (not background). If the user taps "Cancel" on the permission dialog, the app returns to active, which was incorrectly triggering the
App Openedanalytics event.The fix tightens the condition in
AppStateEventListenerto only fireAPP_OPENEDwhen transitioning from background → active, which represents the user genuinely re-opening the app. Transitions from inactive → active (system dialogs, incoming calls, etc.) are now correctly ignored.Changelog
CHANGELOG entry:null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-256
Manual testing steps
Screenshots/Recordings
~Before
~After
~Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes the gating logic for when
APP_OPENEDis emitted, which can impact analytics counts and attribution if the app state transitions are misclassified on some platforms.Overview
Tightens
APP_OPENEDtracking to reduce false positives.AppStateEventListenernow triggers the event only onbackground→activetransitions, and explicitly ignoresinactive→activereturns (e.g., iOS permission dialogs/calls).Tests are updated to reflect the required
background→activesequence for firing, and add coverage to ensureAPP_OPENEDdoes not re-fire on repeatedactivestates or oninactive→activetransitions.Written by Cursor Bugbot for commit dd64cc6. This will update automatically on new commits. Configure here.