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
{{ message }}
Repository navigation
[Due for payment 2026-04-28] [Due for payment 2026-03-30] Android - Chat does not open after closing chat and opening another chat from FAB #85687
Version Number: 9.3.40-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#83899 Email or phone of affected tester (no customers):sdjsdjosijnsodiosd@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Samsung Galaxy S25 FE / Android 16 App Component: Chat Report View
Action Performed:
Launch Expensify app.
Open FAB > Start chat.
Select any user from Recents or Contacts list.
Tap app back button.
Open FAB > Start chat.
Select any user from Recents or Contacts list.
Expected Result:
Chat report will open.
Actual Result:
Chat report does not open after closing chat report and opening another chat from FAB.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #83899 - "Migration navigation from InteractionManager to TransitionTracker V2" by @collectioneur (High confidence) Related Issues: Part of #71913 (TransitionTracker migration parent issue)
Recommendation: REVERT
PR #83899 introduces the TransitionTracker system to replace InteractionManager for handling navigation transitions. The bug occurs specifically when:
Opening FAB > Start chat
Selecting a user
Going back (Android back button)
Opening FAB > Start chat again
Selecting another user
The chat report fails to open
This matches test case #4 from the PR description: "Navigate to a chat from FAB (RHP)".
Labels: No changes needed. DeployBlockerCash is correctly applied (blocks App deploy). DeployBlocker is not present, which is correct since this is a frontend bug requiring an App revert, not a backend fix.
📋 Detailed Analysis
Evidence
The issue is only reproducible on staging, not production, confirming it was introduced in the current deploy
The PR changed from the old callback pattern to the new afterTransition pattern. The dismissModal function now wraps the modal dismissal in TransitionTracker.runAfterTransitions, and then the afterTransition callback is scheduled with waitForUpcomingTransition: true.
Root Cause
The TransitionTracker system relies on transitionStart and transitionEnd events from React Navigation to properly track transitions. On Android (React Navigation Native Stack), these events may not be firing reliably, or there is a race condition where:
The first modal dismissal starts a transition
The afterTransition callback is queued with waitForUpcomingTransition: true, waiting for the next transition to start
On the second attempt to open a chat, the transition tracking state is corrupted or the callback queue is not properly handled
The navigation to the report never executes
The issue is specific to Android because the native stack navigator on Android may have different timing characteristics than iOS or web.
Please re-state the problem that we are trying to solve in this issue.
On Android, when a user opens FAB > Start Chat, selects a user (chat opens), presses the back button, then opens FAB > Start Chat again and selects another user, the second chat report does not open. This is reproducible on staging (v9.3.40-0) but not production, confirming it was introduced by PR #83899.
What is the root cause of that problem?
PR #83899 replaced the synchronous callback pattern in dismissModal with the new afterTransition + waitForUpcomingTransition pattern powered by TransitionTracker.
The flow in NewChatPage.tsx:386-393 when selecting an existing chat:
The waitForUpcomingTransition: true flag (TransitionTracker.ts:109-114) creates an async function that awaits promiseForNextTransitionStart — it waits for the next startTransition() call before queuing the callback to run when activeCount hits 0.
The ScreenLayout component (ScreenLayout.tsx:22-34) listens for transitionStart/transitionEnd events on each screen's navigation object and calls TransitionTracker.startTransition()/endTransition() accordingly. When a screen unmounts, the listeners are cleaned up.
The bug mechanism on Android: When DISMISS_MODAL pops the RHP from the root stack, the native stack navigator (backed by react-native-screens Fragments) fires transition events for both the disappearing (RHP) and appearing (underlying) screens. However, on Android, the RHP's ScreenLayout component may be torn down before transitionEnd fires for the disappearing screen. This means startTransition() is called (incrementing activeCount) but the corresponding endTransition() never fires, leaving activeCount stuck at a positive value.
While there's a 1000ms safety timeout (CONST.MAX_TRANSITION_DURATION_MS) that eventually calls decrementAndFlush(), this creates a significant delay window. On the second attempt, the accumulated transition imbalance from both the first dismiss and the back navigation means activeCount is persistently elevated. The afterTransition callback gets queued in pendingCallbacks but waits for activeCount to reach 0, which is blocked by multiple unresolved transitions. From the user's perspective, the chat simply doesn't open (or opens with such a delay that it appears broken).
This is Android-specific because @react-navigation/native-stack on Android uses Fragment-based screen management which may detach the React component tree before the native exit animation completes its transitionEnd event, unlike iOS where UIKit preserves the component longer.
What changes do you think we should make in order to solve the problem?
Given this is a deploy blocker, the safest and fastest fix is to revert PR #83899. The TransitionTracker V2 migration has a fundamental timing issue on Android where screen unmounting can race with transition event delivery, causing unbalanced startTransition/endTransition pairs.
If a revert is not desired, an alternative fix would be to modify ScreenLayout.tsx to call TransitionTracker.endTransition() in the useLayoutEffect cleanup function when the component unmounts during an active transition. This would ensure that any transition started by that screen is properly ended even if the transitionEnd event never fires:
In ScreenLayout.tsx, the cleanup should detect if this screen started a transition that hasn't ended and call endTransition() to rebalance the counter. This prevents the orphaned startTransition from blocking subsequent afterTransition callbacks.
What alternative solutions did you explore? (Optional)
Adding endTransition() to ScreenLayout cleanup — This would fix the immediate imbalance but may mask other timing issues. The transitionEnd event might fire AFTER cleanup, causing a double endTransition() (though decrementAndFlush guards against activeCount < 0).
Removing waitForUpcomingTransition from dismissModal — The callback could use runAfterTransitions without waitForUpcomingTransition, but this would fire the navigation before the dismiss animation completes, potentially causing visual glitches.
Reverting to the old callback pattern for dismissModal only — Keep TransitionTracker for other uses but restore the synchronous callback behavior in dismissModal. This is a partial revert that targets the specific broken flow.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
@srikarparsi The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
changed the title [-][Due for payment 2026-03-30] Android - Chat does not open after closing chat and opening another chat from FAB[/-][+][Due for payment 2026-04-28] [Due for payment 2026-03-30] Android - Chat does not open after closing chat and opening another chat from FAB[/+]on Apr 21, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.60-22 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@srikarparsi@mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Mar 18, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #83899
melvin-bot commentedon Mar 18, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 18, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon Mar 18, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #83899 - "Migration navigation from InteractionManager to TransitionTracker V2" by @collectioneur (High confidence)
Related Issues: Part of #71913 (TransitionTracker migration parent issue)
Recommendation: REVERT
PR #83899 introduces the TransitionTracker system to replace InteractionManager for handling navigation transitions. The bug occurs specifically when:
This matches test case #4 from the PR description: "Navigate to a chat from FAB (RHP)".
Labels: No changes needed.
DeployBlockerCashis correctly applied (blocks App deploy).DeployBlockeris not present, which is correct since this is a frontend bug requiring an App revert, not a backend fix.📋 Detailed Analysis
Evidence
Verification
The PR modifies
src/pages/NewChatPage.tsxlines 386-393:The PR changed from the old
callbackpattern to the newafterTransitionpattern. ThedismissModalfunction now wraps the modal dismissal inTransitionTracker.runAfterTransitions, and then theafterTransitioncallback is scheduled withwaitForUpcomingTransition: true.Root Cause
The TransitionTracker system relies on
transitionStartandtransitionEndevents from React Navigation to properly track transitions. On Android (React Navigation Native Stack), these events may not be firing reliably, or there is a race condition where:afterTransitioncallback is queued withwaitForUpcomingTransition: true, waiting for the next transition to startThe issue is specific to Android because the native stack navigator on Android may have different timing characteristics than iOS or web.
MelvinBot commentedon Mar 18, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, when a user opens FAB > Start Chat, selects a user (chat opens), presses the back button, then opens FAB > Start Chat again and selects another user, the second chat report does not open. This is reproducible on staging (v9.3.40-0) but not production, confirming it was introduced by PR #83899.
What is the root cause of that problem?
PR #83899 replaced the synchronous
callbackpattern indismissModalwith the newafterTransition+waitForUpcomingTransitionpattern powered byTransitionTracker.The flow in
NewChatPage.tsx:386-393when selecting an existing chat:Inside
dismissModal(Navigation.ts:765-779), this dispatchesDISMISS_MODALto pop the RHP, then calls:The
waitForUpcomingTransition: trueflag (TransitionTracker.ts:109-114) creates an async function that awaitspromiseForNextTransitionStart— it waits for the nextstartTransition()call before queuing the callback to run whenactiveCounthits 0.The
ScreenLayoutcomponent (ScreenLayout.tsx:22-34) listens fortransitionStart/transitionEndevents on each screen's navigation object and callsTransitionTracker.startTransition()/endTransition()accordingly. When a screen unmounts, the listeners are cleaned up.The bug mechanism on Android: When
DISMISS_MODALpops the RHP from the root stack, the native stack navigator (backed byreact-native-screensFragments) fires transition events for both the disappearing (RHP) and appearing (underlying) screens. However, on Android, the RHP'sScreenLayoutcomponent may be torn down beforetransitionEndfires for the disappearing screen. This meansstartTransition()is called (incrementingactiveCount) but the correspondingendTransition()never fires, leavingactiveCountstuck at a positive value.While there's a 1000ms safety timeout (
CONST.MAX_TRANSITION_DURATION_MS) that eventually callsdecrementAndFlush(), this creates a significant delay window. On the second attempt, the accumulated transition imbalance from both the first dismiss and the back navigation meansactiveCountis persistently elevated. TheafterTransitioncallback gets queued inpendingCallbacksbut waits foractiveCountto reach 0, which is blocked by multiple unresolved transitions. From the user's perspective, the chat simply doesn't open (or opens with such a delay that it appears broken).This is Android-specific because
@react-navigation/native-stackon Android uses Fragment-based screen management which may detach the React component tree before the native exit animation completes itstransitionEndevent, unlike iOS where UIKit preserves the component longer.What changes do you think we should make in order to solve the problem?
Given this is a deploy blocker, the safest and fastest fix is to revert PR #83899. The TransitionTracker V2 migration has a fundamental timing issue on Android where screen unmounting can race with transition event delivery, causing unbalanced
startTransition/endTransitionpairs.If a revert is not desired, an alternative fix would be to modify
ScreenLayout.tsxto callTransitionTracker.endTransition()in theuseLayoutEffectcleanup function when the component unmounts during an active transition. This would ensure that any transition started by that screen is properly ended even if thetransitionEndevent never fires:In
ScreenLayout.tsx, the cleanup should detect if this screen started a transition that hasn't ended and callendTransition()to rebalance the counter. This prevents the orphanedstartTransitionfrom blocking subsequentafterTransitioncallbacks.What alternative solutions did you explore? (Optional)
endTransition()to ScreenLayout cleanup — This would fix the immediate imbalance but may mask other timing issues. ThetransitionEndevent might fire AFTER cleanup, causing a doubleendTransition()(thoughdecrementAndFlushguards againstactiveCount < 0).waitForUpcomingTransitionfromdismissModal— The callback could userunAfterTransitionswithoutwaitForUpcomingTransition, but this would fire the navigation before the dismiss animation completes, potentially causing visual glitches.callbackpattern fordismissModalonly — Keep TransitionTracker for other uses but restore the synchronous callback behavior indismissModal. This is a partial revert that targets the specific broken flow.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.m-natarajan commentedon Mar 19, 2026
Issue no longer reproducible on build 9.3.40-3. Retested on Motorola Moto G60 - Android 12
screen-20260318-224548.mp4
srikarparsi commentedon Mar 19, 2026
Sounds great, thank you
6 remaining items
melvin-bot commentedon Mar 23, 2026
@srikarparsi The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon Mar 23, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)mallenexpensify commentedon Mar 30, 2026
If the regression penalty applies, comment on the issue linked to the PR that introduced the regression. Thx
melvin-bot commentedon Apr 17, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
[-][Due for payment 2026-03-30] Android - Chat does not open after closing chat and opening another chat from FAB[/-][+][Due for payment 2026-04-28] [Due for payment 2026-03-30] Android - Chat does not open after closing chat and opening another chat from FAB[/+]melvin-bot commentedon Apr 21, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 21, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.60-22 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-04-28. 🎊
melvin-bot commentedon Apr 21, 2026
@srikarparsi @mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]