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-08-03] [$250] iOS-Expense-The share screen does not close when swiping back #94908
Version Number: v9.4.23-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#93268 Email or phone of affected tester (no customers):agexptest+pr290626@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: iPhone 13 Mini/ iOS 26.5 App Component: Money Requests
Action Performed:
From another app, use the OS Share menu > tap Share to Expensify
So the iOS edge-swipe never dismisses the parent SHARE_MODAL_NAVIGATOR route. The top-left back button still works because it explicitly navigates away with Navigation.navigate(ROUTES.INBOX), but the native swipe gesture is disabled at the root share-modal route level.
The Share/Submit tab switch makes this more visible, but the issue is not in the tab router. The swipe has to dismiss the parent share modal route, and that parent route is currently configured with gestures off.
What changes do you think we should make in order to solve the problem?
Enable the native swipe gesture only for SHARE_MODAL_NAVIGATOR, while keeping the existing fullScreen options and no-animation behavior:
This is scoped to the Share modal only. Other routes using fullScreen keep their existing behavior.
Test coverage:
Manually verify on iOS by opening Share to Expensify from the OS share sheet, switching between Share and Submit, then swiping back and confirming the share screen closes.
If adding automated coverage, cover the Share modal route options so SHARE_MODAL_NAVIGATOR keeps gestureEnabled: true while other full-screen routes remain unchanged.
What alternative solutions did you explore? (Optional)
Changing OnyxTabNavigatorbackBehavior was considered, but it targets the wrong layer. With gestureEnabled: false, the iOS swipe never reaches the nested tab navigator as a back action. Changing the global fullScreen or Animations.NONE preset was also rejected because it would affect unrelated full-screen routes. A share-modal-only override has the smallest blast radius.
Please re-state the problem that we are trying to solve in this issue.
On iOS, when a file is shared to Expensify via the OS Share menu, the Share screen shows two tabs (Share and Submit). After switching between the Share and Submit tabs and then swiping back, the Share screen does not close as expected — it stays open.
What is the root cause of that problem?
The Share screen renders its two tabs through OnyxTabNavigator (a Material Top Tab navigator) inside the share modal. On native, the tab navigator is configured with backBehavior: 'initialRoute'.
With backBehavior: 'initialRoute', React Navigation's TabRouter handles a GO_BACK action by checking the focused tab: if the focused tab is not the initial route, it consumes the action and switches back to the initial tab instead of letting the action bubble up. The swipe‑back gesture dispatches exactly this GO_BACK action, and since the gesture is handled by the focused (nested) tab navigator first, the action never reaches the parent stack.
So the behavior depends on which tab is focused:
While on the initial tab, GO_BACK is not consumed by the tab router, bubbles up to the share modal stack, and the screen closes.
After switching to the other (non‑initial) tab, GO_BACK is consumed by the tab router (which just switches back to the initial tab), so the share modal never receives the action and the screen does not close.
This is why the reproduction requires switching tabs first: ending on a non‑initial tab makes the tab navigator swallow the swipe‑back gesture.
What changes do you think we should make in order to solve the problem?
Let OnyxTabNavigator accept a backBehavior override so the Share screen can opt out of 'initialRoute', and use 'none' for the Share tab navigator. With 'none', the tab router does not handle GO_BACK, so the action bubbles up to the share modal stack and the screen closes regardless of which tab is focused.
Import the config value under an alias and add the type used to describe the prop.
The backBehavior={backBehavior} line already passed to TopTab.Navigator now reads the prop instead of the imported constant, so no change is needed there.
Opt the Share tab navigator out of 'initialRoute' so swipe‑back closes the modal.
The local evidence matches this recurring failure shape: route params are created in one format and read in another. Here, src/pages/media/AttachmentModalScreen/routes/ShareDetailsAttachmentModalContent.tsx:13 and src/pages/media/AttachmentModalScreen/AttachmentModalBaseContent/index.tsx:109 do not agree on the same the issue-specific state value, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.
What changes do you think we should make in order to solve the problem?
Update src/pages/media/AttachmentModalScreen/routes/ShareDetailsAttachmentModalContent.tsx:13 to derive the issue-specific state from the route/access source that owns this flow before the value is consumed.
Carry the same normalized value through src/pages/media/AttachmentModalScreen/AttachmentModalBaseContent/index.tsx:109; that follows the safer family move to fix the route builder/consumer pair instead of adding a screen-only redirect, so the write/optimistic/read paths agree instead of only changing the visible component.
Keep the change inside the Navigation, RHP, Not Here, Back Stack surface and avoid changing deep links, auth/onboarding redirects.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add or update a regression in tests/navigation/**/*.ts for the exact issue flow: iOS-Expense-The share screen does not close when swiping back.
Cover the counter-case near src/pages/media/AttachmentModalScreen/routes/ShareDetailsAttachmentModalContent.tsx:13 so valid existing the issue-specific state behavior still works.
Manually repeat the issue steps after the patch and confirm the visible state/action is no longer stale.
What alternative solutions did you explore? (Optional)
I would not add a broad new condition outside these referenced paths; the safer fix is to keep the issue-specific state consistent at the first read/write boundary shown above.
Please re-state the problem that we are trying to solve in this issue.
On iOS, after opening Expensify from the system share sheet and switching between the Share and Submit tabs, swiping back does not close the share screen.
What is the root cause of that problem?
In src/libs/Navigation/AppNavigator/AuthScreens.tsx, NAVIGATORS.SHARE_MODAL_NAVIGATOR is registered with the generic rootNavigatorScreenOptions.fullScreen options. This route does not explicitly enable the iOS stack dismissal gesture, so after the nested ShareModalStackNavigator changes tabs, the swipe is not handled as a pop of the root share-modal route.
What changes do you think we should make in order to solve the problem?
Update the options for NAVIGATORS.SHARE_MODAL_NAVIGATOR in AuthScreens to retain rootNavigatorScreenOptions.fullScreen while explicitly setting gestureEnabled: true. This makes the edge swipe pop the root share-modal navigator and close the share flow regardless of which nested Share/Submit tab is active.
Add a navigation test covering opening the share modal, changing its nested tab, and dispatching the back gesture/action to verify that the share-modal route is removed.
What alternative solutions did you explore? (Optional)
Handling back separately inside each Share/Submit tab would duplicate dismissal logic and would not address the root navigator configuration that owns presentation of the share flow.
changed the title [-]iOS-Expense-The share screen does not close when swiping back[/-][+][$250] iOS-Expense-The share screen does not close when swiping back[/+]on Jun 29, 2026
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
applause-bot commentedon Jun 29, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/040bdef537f9768383b6794f132e895f611f3b9e28dc77d1833d0fea4d6535b4
KJ21-ENG commentedon Jun 29, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-06-30 11:37:54 UTC.
Proposal
What is the root cause of that problem?
The Share flow is mounted on the root stack as
SHARE_MODAL_NAVIGATORwithrootNavigatorScreenOptions.fullScreen:https://github.com/Expensify/App/blob/44ba68fbce40783d0397a0a04777443acbc888c0/src/libs/Navigation/AppNavigator/AuthScreens.tsx#L297-L302
The
fullScreenpreset usesAnimations.NONE:https://github.com/Expensify/App/blob/44ba68fbce40783d0397a0a04777443acbc888c0/src/libs/Navigation/AppNavigator/useRootNavigatorScreenOptions.ts#L93-L103
On native, the
NONEanimation preset also disables the swipe gesture by settinggestureEnabled: false:https://github.com/Expensify/App/blob/44ba68fbce40783d0397a0a04777443acbc888c0/src/libs/Navigation/PlatformStackNavigation/navigationOptions/animation/none/index.native.ts#L5-L8
So the iOS edge-swipe never dismisses the parent
SHARE_MODAL_NAVIGATORroute. The top-left back button still works because it explicitly navigates away withNavigation.navigate(ROUTES.INBOX), but the native swipe gesture is disabled at the root share-modal route level.The Share/Submit tab switch makes this more visible, but the issue is not in the tab router. The swipe has to dismiss the parent share modal route, and that parent route is currently configured with gestures off.
What changes do you think we should make in order to solve the problem?
Enable the native swipe gesture only for
SHARE_MODAL_NAVIGATOR, while keeping the existingfullScreenoptions and no-animation behavior:This is scoped to the Share modal only. Other routes using
fullScreenkeep their existing behavior.Test coverage:
SHARE_MODAL_NAVIGATORkeepsgestureEnabled: truewhile other full-screen routes remain unchanged.What alternative solutions did you explore? (Optional)
Changing
OnyxTabNavigatorbackBehaviorwas considered, but it targets the wrong layer. WithgestureEnabled: false, the iOS swipe never reaches the nested tab navigator as a back action. Changing the globalfullScreenorAnimations.NONEpreset was also rejected because it would affect unrelated full-screen routes. A share-modal-only override has the smallest blast radius.abbasifaizan70 commentedon Jun 29, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
The Share screen renders its two tabs through
OnyxTabNavigator(a Material Top Tab navigator) inside the share modal. On native, the tab navigator is configured withbackBehavior: 'initialRoute'.App/src/libs/Navigation/OnyxTabNavigatorConfig/index.ts
Lines 1 to 10 in fd2b949
This
backBehaviorvalue is imported and applied unconditionally to everyOnyxTabNavigatorinstance, including the one on the Share screen.App/src/libs/Navigation/OnyxTabNavigator.tsx
Lines 165 to 170 in fd2b949
The Share screen mounts the tab navigator without overriding the back behavior, so it inherits
'initialRoute'.App/src/pages/Share/ShareRootPage.tsx
Lines 183 to 191 in fd2b949
With
backBehavior: 'initialRoute', React Navigation'sTabRouterhandles aGO_BACKaction by checking the focused tab: if the focused tab is not the initial route, it consumes the action and switches back to the initial tab instead of letting the action bubble up. The swipe‑back gesture dispatches exactly thisGO_BACKaction, and since the gesture is handled by the focused (nested) tab navigator first, the action never reaches the parent stack.So the behavior depends on which tab is focused:
GO_BACKis not consumed by the tab router, bubbles up to the share modal stack, and the screen closes.GO_BACKis consumed by the tab router (which just switches back to the initial tab), so the share modal never receives the action and the screen does not close.This is why the reproduction requires switching tabs first: ending on a non‑initial tab makes the tab navigator swallow the swipe‑back gesture.
What changes do you think we should make in order to solve the problem?
Let
OnyxTabNavigatoraccept abackBehavioroverride so the Share screen can opt out of'initialRoute', and use'none'for the Share tab navigator. With'none', the tab router does not handleGO_BACK, so the action bubbles up to the share modal stack and the screen closes regardless of which tab is focused.App/src/libs/Navigation/OnyxTabNavigator.tsx
Lines 1 to 18 in fd2b949
OnyxTabNavigatorProps.App/src/libs/Navigation/OnyxTabNavigator.tsx
Lines 49 to 50 in fd2b949
App/src/libs/Navigation/OnyxTabNavigator.tsx
Line 97 in fd2b949
The
backBehavior={backBehavior}line already passed toTopTab.Navigatornow reads the prop instead of the imported constant, so no change is needed there.'initialRoute'so swipe‑back closes the modal.App/src/pages/Share/ShareRootPage.tsx
Lines 183 to 187 in fd2b949
melvin-bot commentedon Jun 29, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (
External)godzillaxbox19982014-lgtm commentedon Jun 29, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
iOS-Expense-The share screen does not close when swiping back
What is the root cause of that problem?
I traced this to the path that handles
the issue-specific state:source):const source = useMemo(() => Number(sourceParam) || (typeof sourceParam === 'string' ? tryResolveUrlFromApiRoot(decodeURIComponent(sourceParam)) : undefined), [sourceParam]);index):const [files, setFilesInternal] = useState<FileObject | FileObject[] | undefined>(() => filesProp ?? fallbackFile);focusedLeaf):const focusedLeaf = getFocusedLeafScreenName(activeRoute.state) ?? activeRoute.name;src/pages/media/AttachmentModalScreen/routes/ShareDetailsAttachmentModalContent.tsx:13andsrc/pages/media/AttachmentModalScreen/AttachmentModalBaseContent/index.tsx:109do not agree on the samethe issue-specific statevalue, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.What changes do you think we should make in order to solve the problem?
src/pages/media/AttachmentModalScreen/routes/ShareDetailsAttachmentModalContent.tsx:13to derivethe issue-specific statefrom the route/access source that owns this flow before the value is consumed.src/pages/media/AttachmentModalScreen/AttachmentModalBaseContent/index.tsx:109; that follows the safer family move to fix the route builder/consumer pair instead of adding a screen-only redirect, so the write/optimistic/read paths agree instead of only changing the visible component.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
tests/navigation/**/*.tsfor the exact issue flow: iOS-Expense-The share screen does not close when swiping back.src/pages/media/AttachmentModalScreen/routes/ShareDetailsAttachmentModalContent.tsx:13so valid existingthe issue-specific statebehavior still works.What alternative solutions did you explore? (Optional)
the issue-specific stateconsistent at the first read/write boundary shown above.kitvasyl commentedon Jun 29, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS, after opening Expensify from the system share sheet and switching between the Share and Submit tabs, swiping back does not close the share screen.
What is the root cause of that problem?
In
src/libs/Navigation/AppNavigator/AuthScreens.tsx,NAVIGATORS.SHARE_MODAL_NAVIGATORis registered with the genericrootNavigatorScreenOptions.fullScreenoptions. This route does not explicitly enable the iOS stack dismissal gesture, so after the nestedShareModalStackNavigatorchanges tabs, the swipe is not handled as a pop of the root share-modal route.What changes do you think we should make in order to solve the problem?
Update the options for
NAVIGATORS.SHARE_MODAL_NAVIGATORinAuthScreensto retainrootNavigatorScreenOptions.fullScreenwhile explicitly settinggestureEnabled: true. This makes the edge swipe pop the root share-modal navigator and close the share flow regardless of which nested Share/Submit tab is active.Add a navigation test covering opening the share modal, changing its nested tab, and dispatching the back gesture/action to verify that the share-modal route is removed.
What alternative solutions did you explore? (Optional)
Handling back separately inside each Share/Submit tab would duplicate dismissal logic and would not address the root navigator configuration that owns presentation of the share flow.
melvin-bot commentedon Jun 29, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022071707710356671699
[-]iOS-Expense-The share screen does not close when swiping back[/-][+][$250] iOS-Expense-The share screen does not close when swiping back[/+]lorretheboy commentedon Jun 29, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
58 remaining items
melvin-bot commentedon Jul 30, 2026
@shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Aug 2, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 2, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
shubham1206agra commentedon Aug 5, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: https://github.com/Expensify/App/pull/58834/changes#r3720604815
Link to the comment on the Issue: NA
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/668942
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-41a6-ac73-c0ca-7aad9d79b294shubham1206agra commentedon Aug 5, 2026
@mallenexpensify This is ready for payment
melvin-bot commentedon Aug 5, 2026
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
mallenexpensify commentedon Aug 5, 2026
Payment Summary
Contributor: @samranahm paid $250 via Upwork
Contributor+: @shubham1206agra due $250 via NewDot
^ Test case created. Thx
JmillsExpensify commentedon Aug 10, 2026
$250 approved for @shubham1206agra