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 - Scan - App returns to confirm page after tapping Replace #85696
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: Money Requests
Action Performed:
Launch Expensify app.
Go to workspace chat.
Tap + > Create expense > Scan.
Upload a photo.
On confirm page, tap on the receipt.
Tap Replace.
Expected Result:
Replace receipt page will open.
Actual Result:
App returns to confirm page after tapping Replace.
👋 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: #85687 (same root cause), 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 when tapping "Replace" on a receipt in the confirmation page - instead of navigating to the replace receipt page, the app returns to the confirm page.
This is one of several Android-specific navigation failures introduced by this PR, all sharing the same root cause.
Labels: No changes needed. DeployBlockerCash is correctly applied (blocks App deploy). Issue is not reproducible on production, only staging, confirming it was introduced in this deploy.
📋 Detailed Analysis
Evidence
The issue is only reproducible on staging, not production, confirming it was introduced in the current deploy
The PR removed the Android-specific navigation flow that used goBack() + setNavigationActionToMicrotaskQueue() and replaced it with the unified dismissModal({ afterTransition }) approach powered by TransitionTracker.
Root Cause
The TransitionTracker system relies on transitionStart and transitionEnd events from React Navigation to track when transitions complete. The dismissModal function with afterTransition calls:
The waitForUpcomingTransition: true flag creates an async flow that waits for the next startTransition() call before queuing the callback.
On Android with @react-navigation/native-stack, the Fragment-based screen management can cause the ScreenLayout component to be torn down before the transitionEnd event fires for the disappearing screen. This leaves startTransition() called (incrementing activeCount) but the corresponding endTransition() never fires, leaving activeCount stuck at a positive value.
While there's a 1000ms safety timeout, the accumulated transition imbalance means the afterTransition callback (which navigates to the replace receipt page) gets queued but waits indefinitely for activeCount to reach 0. From the user's perspective, nothing happens when they tap "Replace" - they just return to the confirm page.
This is Android-specific because of how react-native-screens manages Fragment lifecycle differently than iOS UIKit.
Please re-state the problem that we are trying to solve in this issue.
On Android, when viewing a scanned receipt in the attachment modal and tapping "Replace", the app dismisses the modal but never navigates to the Replace receipt page. The user is left on the confirm page with no way to replace the receipt (other than starting over). This is a regression introduced by PR #83899 which migrated from InteractionManager to TransitionTracker.
What is the root cause of that problem?
PR #83899 replaced a native-specific code path in TransactionReceiptModalContent.tsx with a unified dismissModal({ afterTransition }) call. The old code used Navigation.goBack() + setNavigationActionToMicrotaskQueue() which reliably deferred the navigation. The new code relies on TransitionTracker to detect when the dismiss transition completes.
The problem is a race condition between React component unmount and native transition events on Android's native-stack navigator:
dismissModal dispatches DISMISS_MODAL (a pop action), removing the attachment modal route from the navigation state.
NativeStackView re-renders without the popped screen — React unmounts the ScreenLayout component for that screen, which removes the transitionStart/transitionEnd event listeners.
The afterTransition callback is registered via TransitionTracker.runAfterTransitions({ waitForUpcomingTransition: true }), which awaits promiseForNextTransitionStart before queuing.
The native ScreenStack begins the exit animation and fires onWillDisappear/onDisappear callbacks — but since the React component was already unmounted, these events either don't reach JS or their listeners are gone.
If startTransition() is never called for the popped screen, and no other transition fires, promiseForNextTransitionStart never resolves and the afterTransition callback (which navigates to the Replace receipt page) is permanently lost.
On web, this doesn't happen because the attachment modal uses ReanimatedModal which has its own independent TransitionTracker.startTransition()/endTransition() calls. On native, the attachment modal is a plain native stack screen (AttachmentModalContainer/index.native.tsx renders a ScreenWrapper, not a Modal), so the only transition tracking comes from ScreenLayout — which is subject to the unmount race.
Key code locations:
src/pages/media/AttachmentModalScreen/routes/TransactionReceiptModalContent.tsx ~line 525: the dismissModal({ afterTransition }) call
src/libs/Navigation/Navigation.ts ~line 765-779: dismissModal registers afterTransition with waitForUpcomingTransition: true
src/libs/Navigation/PlatformStackNavigation/ScreenLayout.tsx ~line 22-34: listeners are removed on unmount
What changes do you think we should make in order to solve the problem?
Restore the native-specific code path in TransactionReceiptModalContent.tsx that was removed by PR #83899. The old approach used Navigation.goBack() + Navigation.setNavigationActionToMicrotaskQueue() which doesn't depend on TransitionTracker detecting transition events and is reliable on native platforms.
Specifically, re-add the isNative check in the Replace handler so that on native platforms, the code calls Navigation.goBack() followed by setNavigationActionToMicrotaskQueue(() => Navigation.navigate(getDestinationRoute())) instead of Navigation.dismissModal({ afterTransition }).
What alternative solutions did you explore? (Optional)
Call endTransition() in ScreenLayout's cleanup function — This would prevent the activeCount leak, but doesn't address the case where startTransition() for the popped screen never fires at all (meaning promiseForNextTransitionStart may never resolve).
Track transitions at the navigator level instead of per-screen — This is a more architectural fix to TransitionTracker that would avoid the unmount race entirely, but has a much larger scope and risk.
Call startTransition()/endTransition() directly in dismissModal — This would ensure the promise resolves, but conflates the transition tracking abstraction and could cause double-counting.
The simplest and safest fix for this deploy blocker is option 1 in the main proposal: restore the proven native code path.
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 - Scan - App returns to confirm page after tapping Replace[/-][+][Due for payment 2026-04-28] [Due for payment 2026-03-30] Android - Scan - App returns to confirm page after tapping Replace[/+]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: #85687 (same root cause), 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 when tapping "Replace" on a receipt in the confirmation page - instead of navigating to the replace receipt page, the app returns to the confirm page.
This is one of several Android-specific navigation failures introduced by this PR, all sharing the same root cause.
Labels: No changes needed.
DeployBlockerCashis correctly applied (blocks App deploy). Issue is not reproducible on production, only staging, confirming it was introduced in this deploy.📋 Detailed Analysis
Evidence
Verification
The PR modified
src/pages/media/AttachmentModalScreen/routes/TransactionReceiptModalContent.tsxat lines 521-527.Before (working on production):
After (broken on staging):
The PR removed the Android-specific navigation flow that used
goBack()+setNavigationActionToMicrotaskQueue()and replaced it with the unifieddismissModal({ afterTransition })approach powered by TransitionTracker.Root Cause
The TransitionTracker system relies on
transitionStartandtransitionEndevents from React Navigation to track when transitions complete. ThedismissModalfunction withafterTransitioncalls:The
waitForUpcomingTransition: trueflag creates an async flow that waits for the nextstartTransition()call before queuing the callback.On Android with
@react-navigation/native-stack, the Fragment-based screen management can cause theScreenLayoutcomponent to be torn down before thetransitionEndevent fires for the disappearing screen. This leavesstartTransition()called (incrementingactiveCount) but the correspondingendTransition()never fires, leavingactiveCountstuck at a positive value.While there's a 1000ms safety timeout, the accumulated transition imbalance means the
afterTransitioncallback (which navigates to the replace receipt page) gets queued but waits indefinitely foractiveCountto reach 0. From the user's perspective, nothing happens when they tap "Replace" - they just return to the confirm page.This is Android-specific because of how
react-native-screensmanages Fragment lifecycle differently than iOS UIKit.Pujan92 commentedon Mar 18, 2026
Strange, @lanitochka17 I don't see the issue in emulator
f1.webm
MelvinBot commentedon Mar 18, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, when viewing a scanned receipt in the attachment modal and tapping "Replace", the app dismisses the modal but never navigates to the Replace receipt page. The user is left on the confirm page with no way to replace the receipt (other than starting over). This is a regression introduced by PR #83899 which migrated from
InteractionManagertoTransitionTracker.What is the root cause of that problem?
PR #83899 replaced a native-specific code path in
TransactionReceiptModalContent.tsxwith a unifieddismissModal({ afterTransition })call. The old code usedNavigation.goBack()+setNavigationActionToMicrotaskQueue()which reliably deferred the navigation. The new code relies onTransitionTrackerto detect when the dismiss transition completes.The problem is a race condition between React component unmount and native transition events on Android's native-stack navigator:
dismissModaldispatchesDISMISS_MODAL(a pop action), removing the attachment modal route from the navigation state.NativeStackViewre-renders without the popped screen — React unmounts theScreenLayoutcomponent for that screen, which removes thetransitionStart/transitionEndevent listeners.afterTransitioncallback is registered viaTransitionTracker.runAfterTransitions({ waitForUpcomingTransition: true }), which awaitspromiseForNextTransitionStartbefore queuing.ScreenStackbegins the exit animation and firesonWillDisappear/onDisappearcallbacks — but since the React component was already unmounted, these events either don't reach JS or their listeners are gone.startTransition()is never called for the popped screen, and no other transition fires,promiseForNextTransitionStartnever resolves and theafterTransitioncallback (which navigates to the Replace receipt page) is permanently lost.On web, this doesn't happen because the attachment modal uses
ReanimatedModalwhich has its own independentTransitionTracker.startTransition()/endTransition()calls. On native, the attachment modal is a plain native stack screen (AttachmentModalContainer/index.native.tsxrenders aScreenWrapper, not aModal), so the only transition tracking comes fromScreenLayout— which is subject to the unmount race.Key code locations:
src/pages/media/AttachmentModalScreen/routes/TransactionReceiptModalContent.tsx~line 525: thedismissModal({ afterTransition })callsrc/libs/Navigation/Navigation.ts~line 765-779:dismissModalregistersafterTransitionwithwaitForUpcomingTransition: truesrc/libs/Navigation/TransitionTracker.ts~line 104-122:waitForUpcomingTransitionawaitspromiseForNextTransitionStartsrc/libs/Navigation/PlatformStackNavigation/ScreenLayout.tsx~line 22-34: listeners are removed on unmountWhat changes do you think we should make in order to solve the problem?
Restore the native-specific code path in
TransactionReceiptModalContent.tsxthat was removed by PR #83899. The old approach usedNavigation.goBack()+Navigation.setNavigationActionToMicrotaskQueue()which doesn't depend onTransitionTrackerdetecting transition events and is reliable on native platforms.Specifically, re-add the
isNativecheck in the Replace handler so that on native platforms, the code callsNavigation.goBack()followed bysetNavigationActionToMicrotaskQueue(() => Navigation.navigate(getDestinationRoute()))instead ofNavigation.dismissModal({ afterTransition }).What alternative solutions did you explore? (Optional)
Call
endTransition()inScreenLayout's cleanup function — This would prevent theactiveCountleak, but doesn't address the case wherestartTransition()for the popped screen never fires at all (meaningpromiseForNextTransitionStartmay never resolve).Track transitions at the navigator level instead of per-screen — This is a more architectural fix to
TransitionTrackerthat would avoid the unmount race entirely, but has a much larger scope and risk.Call
startTransition()/endTransition()directly indismissModal— This would ensure the promise resolves, but conflates the transition tracking abstraction and could cause double-counting.The simplest and safest fix for this deploy blocker is option 1 in the main proposal: restore the proven native code path.
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.
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-223908.mp4
9 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 - Scan - App returns to confirm page after tapping Replace[/-][+][Due for payment 2026-04-28] [Due for payment 2026-03-30] Android - Scan - App returns to confirm page after tapping Replace[/+]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]