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-06-18] [$250] Paywall - Not redirected to Subscription page after clicking Add payment card #89718
Version Number: v9.3.67-3 Reproducible in staging?: Yes Reproducible in production?: Unable to validate in Prod - Provide reasoning. If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/13176677/test-cases/41237668 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Windows 11, Chrome App Component: Other
Open the console and run the following snippet (replace with today’s date and time): Onyx.merge('nvp_private_lastDayFreeTrial', '2026-05-05 01:01:00');
Run the following snippet: Onyx.merge('nvp_private_amountOwed', 1000);
Run the following snippet: Onyx.merge('nvp_private_billingGracePeriodEnd', 1719792000);
Disable the internet connection on the device.
Click FAB > Create Expense > Manual expense > Enter amount > Next
On the Choose recipient page, select the workspace chat.
Click Add payment card
Expected Result:
After clicking Add payment card, the user should be redirected to the Subscription page.
Actual Result:
After clicking Add payment card, the user is not redirected to the Subscription page.
When the user clicks "Add payment card" on the WorkspaceOwnerRestrictedAction page, the handler calls Navigation.closeRHPFlow() followed by Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD). Both calls execute synchronously with no offline guard.
The closeRHPFlow dispatches a StackActions.pop() targeted at the RHP navigator's internal stack. Since the RHP contains both the money request flow (MONEY_REQUEST) and the restricted action screen (RESTRICTED_ACTION), the pop removes only RESTRICTED_ACTION, leaving MONEY_REQUEST as the focused screen.
The subsequent navigate call goes through linkTo, which uses getMinimalAction to drill the action down to the RHP level. The resulting action becomes a PUSH of the SETTINGS screen targeted at the RHP navigator's key. This is where the navigation likely fails silently — the PUSH action dispatched against the RHP's state key may not resolve correctly when the RHP's internal state was just modified by the preceding pop in the same synchronous block, or React Navigation may not process the second dispatch reliably when a transition from the pop is pending.
The core issue is that closeRHPFlow + navigate executes two competing navigation dispatches in the same synchronous call, and neither the navigation helpers nor the button handler account for the transition timing between them.
What changes do you think we should make in order to solve the problem?
In WorkspaceOwnerRestrictedAction/index.tsx, update the addPaymentCard handler to use Navigation.navigate with the waitForTransition option so the second navigation waits for the close animation/state update to complete before dispatching:
The TransitionTracker.runAfterTransitions already supports waitForUpcomingTransition, which waits for the next startTransition call before queuing the callback. When waitForTransition is passed to navigate, runImmediately becomes false, and the linkTo callback is deferred until the pop's transition completes. This ensures getRootState() returns a fully settled state and the PUSH action targets the correct navigator key.
If waitForTransition alone doesn't resolve it, an alternative is to replace the two-step closeRHPFlow + navigate with a single navigation action that replaces the current RHP content — e.g., using Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD, {forceReplace: true}) — avoiding the pop entirely.
What alternative solutions did you explore? (Optional)
Adding an offline guard to the button: Not viable — the navigation is purely client-side and should work offline. The subscription page (PaymentCard/index.tsx) has no FullPageOfflineBlockingView and renders fine offline.
Dispatching both actions as a single batched navigation: React Navigation doesn't natively support batched dispatches, so this would require a custom solution that's more complex than using the existing waitForTransition mechanism.
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.
Please re-state the problem that we are trying to solve in this issue.
When a user with an expired free trial and an outstanding balance is offline and tries to submit an expense, they are shown the paywall (WorkspaceOwnerRestrictedAction) with an "Add payment card" button. Clicking that button does not navigate the user to the Subscription page.
What is the root cause of that problem?
The WorkspaceOwnerRestrictedAction web component (index.tsx) handles the "Add payment card" button press by first calling Navigation.closeRHPFlow() to close the right-hand panel, then immediately calling Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD). closeRHPFlow dispatches a StackActions.pop() synchronously against the navigation ref. The navigate call that follows executes before the navigation state has settled from that pop. When offline this timing mismatch causes the subsequent navigate to land in an inconsistent state and fail silently, so the user remains on the same screen.
There is also a design gap: the web file navigates directly to the "Add payment card" form (ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD), while the native counterpart (index.native.tsx) correctly navigates to the Subscription overview page (ROUTES.SETTINGS_SUBSCRIPTION). Since adding a card requires a live network connection, the Subscription overview is a more appropriate destination when the user is offline — it matches the expected result stated in the issue and aligns web behavior with native.
What changes do you think we should make in order to solve the problem?
Replace the addPaymentCard callback in WorkspaceOwnerRestrictedAction/index.tsx with the same pattern used by the native version: capture the active route on mount with useMemo(() => Navigation.getActiveRoute(), []), then on press call Navigation.closeRHPFlow() followed by Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION.getRoute(activeRoute)). This removes the race condition by navigating to a single, stable destination (the Subscription page) rather than a nested route that requires the prior close animation to complete first, and it also matches the expected result from the issue. The navigateToSubscriptionPayment helper used by TimeSensitiveSection should similarly be updated so that on web it also routes to ROUTES.SETTINGS_SUBSCRIPTION (passing the current active route) rather than the add-payment-card form, keeping both entry points consistent.
changed the title [-]Paywall - Not redirected to Subscription page after clicking Add payment card[/-][+][$250] Paywall - Not redirected to Subscription page after clicking Add payment card[/+]on May 6, 2026
Please re-state the problem that we are trying to solve in this issue.
On web, when a workspace owner with a billing issue (amount owed or grace period) clicks the "Add payment card" button in WorkspaceOwnerRestrictedAction, the app does not navigate to the Add Payment Card page. Instead, the user remains on the workspace chat screen. This prevents the user from completing the payment card addition flow to resolve their billing issue.
What is the root cause of that problem?
The bug originates in src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx in the addPaymentCard function (lines 23–26). The handler calls Navigation.closeRHPFlow() before Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD). The closeRHPFlow() call synchronously dispatches StackActions.pop() to destroy the Right Modal Navigator (RHP) stack. However, SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD is itself an RHP route, so the immediate navigate call races against the in-flight pop operation. The navigation to the Add Payment Card page is effectively swallowed as the RHP stack is being torn down simultaneously.
The working analog is the native platform handler goToSubscription in src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.native.tsx, which correctly pairs closeRHPFlow() with navigation to ROUTES.SETTINGS_SUBSCRIPTION — a non-RHP route that exists outside the modal stack, avoiding the race condition.
What changes do you think we should make in order to solve the problem?
File:src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx Function:addPaymentCard Edit: Remove the Navigation.closeRHPFlow() call. Replace the function body with a direct call to Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD). Since the destination is an RHP route, closing the RHP stack before navigating to a route within it causes the race condition. No new imports are required — Navigation and ROUTES are already present.
Blast radius: Isolated to the addPaymentCard arrow function in the web-only file WorkspaceOwnerRestrictedAction/index.tsx. The native platform file index.native.tsx uses a separate goToSubscription handler that navigates to ROUTES.SETTINGS_SUBSCRIPTION (a non-RHP route) and is correctly paired with closeRHPFlow() — it is not affected by this change.
What alternative solutions did you explore?
Location:src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx:addPaymentCard — navigate to ROUTES.SETTINGS_SUBSCRIPTION.getRoute(activeRoute) instead, mirroring the native goToSubscription handler. Rejection reason: This approach lands the user on the Subscription settings page rather than directly on the Add Payment Card page, requiring an extra tap. The button label is "Add payment card", so the UX intent is to land directly on the Add Payment Card screen. Additionally, this would require adding useMemo and activeRoute derivation unnecessarily when navigating to a fixed RHP route.
⚠️ @dilshodmackbook-sketch Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.5-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@thelullabyy 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]. If no checklist is needed for this issue, you can click: [no checklist button]
[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: NA
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.
@neerajbachani can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal. https://www.upwork.com/jobs/~022051935392949029135
Activity
MelvinBot commentedon May 6, 2026
Proposal
What is the root cause of that problem?
When the user clicks "Add payment card" on the
WorkspaceOwnerRestrictedActionpage, the handler callsNavigation.closeRHPFlow()followed byNavigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD). Both calls execute synchronously with no offline guard.The
closeRHPFlowdispatches aStackActions.pop()targeted at the RHP navigator's internal stack. Since the RHP contains both the money request flow (MONEY_REQUEST) and the restricted action screen (RESTRICTED_ACTION), the pop removes onlyRESTRICTED_ACTION, leavingMONEY_REQUESTas the focused screen.The subsequent
navigatecall goes throughlinkTo, which usesgetMinimalActionto drill the action down to the RHP level. The resulting action becomes aPUSHof theSETTINGSscreen targeted at the RHP navigator's key. This is where the navigation likely fails silently — thePUSHaction dispatched against the RHP's state key may not resolve correctly when the RHP's internal state was just modified by the preceding pop in the same synchronous block, or React Navigation may not process the second dispatch reliably when a transition from the pop is pending.The core issue is that
closeRHPFlow+navigateexecutes two competing navigation dispatches in the same synchronous call, and neither the navigation helpers nor the button handler account for the transition timing between them.What changes do you think we should make in order to solve the problem?
In
WorkspaceOwnerRestrictedAction/index.tsx, update theaddPaymentCardhandler to useNavigation.navigatewith thewaitForTransitionoption so the second navigation waits for the close animation/state update to complete before dispatching:The
TransitionTracker.runAfterTransitionsalready supportswaitForUpcomingTransition, which waits for the nextstartTransitioncall before queuing the callback. WhenwaitForTransitionis passed tonavigate,runImmediatelybecomesfalse, and thelinkTocallback is deferred until the pop's transition completes. This ensuresgetRootState()returns a fully settled state and the PUSH action targets the correct navigator key.If
waitForTransitionalone doesn't resolve it, an alternative is to replace the two-stepcloseRHPFlow+navigatewith a single navigation action that replaces the current RHP content — e.g., usingNavigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD, {forceReplace: true})— avoiding the pop entirely.What alternative solutions did you explore? (Optional)
Adding an offline guard to the button: Not viable — the navigation is purely client-side and should work offline. The subscription page (
PaymentCard/index.tsx) has noFullPageOfflineBlockingViewand renders fine offline.Dispatching both actions as a single batched navigation: React Navigation doesn't natively support batched dispatches, so this would require a custom solution that's more complex than using the existing
waitForTransitionmechanism.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.melvin-bot commentedon May 6, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thelullabyy (
External)MobileMage commentedon May 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user with an expired free trial and an outstanding balance is offline and tries to submit an expense, they are shown the paywall (
WorkspaceOwnerRestrictedAction) with an "Add payment card" button. Clicking that button does not navigate the user to the Subscription page.What is the root cause of that problem?
The
WorkspaceOwnerRestrictedActionweb component (index.tsx) handles the "Add payment card" button press by first callingNavigation.closeRHPFlow()to close the right-hand panel, then immediately callingNavigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD).closeRHPFlowdispatches aStackActions.pop()synchronously against the navigation ref. Thenavigatecall that follows executes before the navigation state has settled from that pop. When offline this timing mismatch causes the subsequent navigate to land in an inconsistent state and fail silently, so the user remains on the same screen.There is also a design gap: the web file navigates directly to the "Add payment card" form (
ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD), while the native counterpart (index.native.tsx) correctly navigates to the Subscription overview page (ROUTES.SETTINGS_SUBSCRIPTION). Since adding a card requires a live network connection, the Subscription overview is a more appropriate destination when the user is offline — it matches the expected result stated in the issue and aligns web behavior with native.App/src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx
Lines 23 to 26 in cab0b7b
What changes do you think we should make in order to solve the problem?
Replace the
addPaymentCardcallback inWorkspaceOwnerRestrictedAction/index.tsxwith the same pattern used by the native version: capture the active route on mount withuseMemo(() => Navigation.getActiveRoute(), []), then on press callNavigation.closeRHPFlow()followed byNavigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION.getRoute(activeRoute)). This removes the race condition by navigating to a single, stable destination (the Subscription page) rather than a nested route that requires the prior close animation to complete first, and it also matches the expected result from the issue. ThenavigateToSubscriptionPaymenthelper used byTimeSensitiveSectionshould similarly be updated so that on web it also routes toROUTES.SETTINGS_SUBSCRIPTION(passing the current active route) rather than the add-payment-card form, keeping both entry points consistent.App/src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.native.tsx
Lines 23 to 27 in cab0b7b
What alternative solutions did you explore? (Optional)
N/A
[-]Paywall - Not redirected to Subscription page after clicking Add payment card[/-][+][$250] Paywall - Not redirected to Subscription page after clicking Add payment card[/+]melvin-bot commentedon May 6, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022051935392949029135
David-2002065 commentedon May 6, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
aswin-s commentedon May 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On web, when a workspace owner with a billing issue (amount owed or grace period) clicks the "Add payment card" button in WorkspaceOwnerRestrictedAction, the app does not navigate to the Add Payment Card page. Instead, the user remains on the workspace chat screen. This prevents the user from completing the payment card addition flow to resolve their billing issue.
What is the root cause of that problem?
The bug originates in
src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsxin theaddPaymentCardfunction (lines 23–26). The handler callsNavigation.closeRHPFlow()beforeNavigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD). ThecloseRHPFlow()call synchronously dispatchesStackActions.pop()to destroy the Right Modal Navigator (RHP) stack. However,SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARDis itself an RHP route, so the immediate navigate call races against the in-flight pop operation. The navigation to the Add Payment Card page is effectively swallowed as the RHP stack is being torn down simultaneously.App/src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx
Lines 23 to 26 in cab0b7b
The working analog is the native platform handler
goToSubscriptioninsrc/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.native.tsx, which correctly pairscloseRHPFlow()with navigation toROUTES.SETTINGS_SUBSCRIPTION— a non-RHP route that exists outside the modal stack, avoiding the race condition.App/src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.native.tsx
Lines 30 to 36 in cab0b7b
What changes do you think we should make in order to solve the problem?
src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsxFunction:
addPaymentCardEdit: Remove the
Navigation.closeRHPFlow()call. Replace the function body with a direct call toNavigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD). Since the destination is an RHP route, closing the RHP stack before navigating to a route within it causes the race condition. No new imports are required —NavigationandROUTESare already present.Blast radius: Isolated to the
addPaymentCardarrow function in the web-only fileWorkspaceOwnerRestrictedAction/index.tsx. The native platform fileindex.native.tsxuses a separategoToSubscriptionhandler that navigates toROUTES.SETTINGS_SUBSCRIPTION(a non-RHP route) and is correctly paired withcloseRHPFlow()— it is not affected by this change.What alternative solutions did you explore?
src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx:addPaymentCard— navigate toROUTES.SETTINGS_SUBSCRIPTION.getRoute(activeRoute)instead, mirroring the nativegoToSubscriptionhandler.Rejection reason: This approach lands the user on the Subscription settings page rather than directly on the Add Payment Card page, requiring an extra tap. The button label is "Add payment card", so the UX intent is to land directly on the Add Payment Card screen. Additionally, this would require adding
useMemoandactiveRoutederivation unnecessarily when navigating to a fixed RHP route.github-actions commentedon May 6, 2026
yusufdeveloper2903 commentedon May 6, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
68 remaining items
melvin-bot commentedon Jun 11, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.5-6 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-06-18. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 11, 2026
@thelullabyy 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]. If no checklist is needed for this issue, you can click: [no checklist button]
thelullabyy commentedon Jun 12, 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: NA
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.
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-3fea-adc9-d82b-c41dae144d04melvin-bot commentedon Jun 17, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)mallenexpensify commentedon Jun 19, 2026
Payment Summary
Contributor: @neerajbachani paid $250 via Upwork
Contributor+: @thelullabyy paid $250 via Upwork
@neerajbachani can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022051935392949029135
^ Test case created. Thx
neerajbachani commentedon Jun 19, 2026
@mallenexpensify I've accepted the offer, thanks!
mallenexpensify commentedon Jun 19, 2026
@neerajbachani paid, summary updated above. Thx.