Skip to content

[Due for payment 2026-06-18] [$250] Paywall - Not redirected to Subscription page after clicking Add payment card #89718

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Sign up using a Gmail address with a +
  3. Click Skip > Manage my team's expenses > 11-50 > QBD > Continue
  4. 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');
  5. Run the following snippet: Onyx.merge('nvp_private_amountOwed', 1000);
  6. Run the following snippet: Onyx.merge('nvp_private_billingGracePeriodEnd', 1719792000);
  7. Disable the internet connection on the device.
  8. Click FAB > Create Expense > Manual expense > Enter amount > Next
  9. On the Choose recipient page, select the workspace chat.
  10. 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.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022051935392949029135
  • Upwork Job ID: 2051935392949029135
  • Last Price Increase: 2026-05-06
  • Automatic offers:
    • thelullabyy | Reviewer | 111420611
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 6, 2026
  2. MelvinBot commented on May 6, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    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:

    const addPaymentCard = () => {
        Navigation.closeRHPFlow();
        Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD, {waitForTransition: true});
    };
    

    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)

    1. 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.

    2. 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.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 6, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 6, 2026
  5. melvin-bot commented on May 6, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @thelullabyy (External)

  6. MobileMage commented on May 6, 2026

    @MobileMage
    Contributor

    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.

    const addPaymentCard = () => {
    Navigation.closeRHPFlow();
    Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD);
    };

    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.

    const activeRoute = useMemo(() => Navigation.getActiveRoute(), []);
    const goToSubscription = useCallback(() => {
    Navigation.closeRHPFlow();
    Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION.getRoute(activeRoute));
    }, [activeRoute]);

    What alternative solutions did you explore? (Optional)

    N/A

  7. 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
  8. melvin-bot commented on May 6, 2026

    @melvin-bot
  9. David-2002065 commented on May 6, 2026

    @David-2002065
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  10. aswin-s commented on May 6, 2026

    @aswin-s
    Contributor

    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.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.

    const addPaymentCard = () => {
    Navigation.closeRHPFlow();
    Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD);
    };

    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.

    <ScreenWrapper
    includeSafeAreaPaddingBottom
    testID="WorkspaceOwnerRestrictedAction"
    >
    <HeaderWithBackButton
    title={translate('workspace.restrictedAction.restricted')}
    onBackButtonPress={Navigation.goBack}

    What changes do you think we should make in order to solve the problem?

    1. 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?

    1. 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.
  11. github-actions commented on May 6, 2026

    @github-actions
    Contributor

    ⚠️ @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.

  12. yusufdeveloper2903 commented on May 6, 2026

    @yusufdeveloper2903
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  13. 68 remaining items

  14. melvin-bot commented on Jun 11, 2026

    @melvin-bot

    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:

  15. melvin-bot commented on Jun 11, 2026

    @melvin-bot

    @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]

  16. thelullabyy commented on Jun 12, 2026

    @thelullabyy
    Contributor

    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:

    1. Go to https://staging.new.expensify.com/
    2. Use a workspace owner in billing-restricted state (or set NVPs per issue repro).
    3. Go offline (disable network)
    4. FAB → Create Expense → Manual expense → amount → Next.
    5. Select workspace chat to open restricted paywall.
    6. Click Add payment card (web).
    7. Verify user is redirected into billing flow subscription with add-card paywall on top.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-3fea-adc9-d82b-c41dae144d04
  17. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jun 12, 2026
  18. melvin-bot commented on Jun 17, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  19. mallenexpensify commented on Jun 19, 2026

    @mallenexpensify
    Contributor

    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

  20. neerajbachani commented on Jun 19, 2026

    @neerajbachani
    Contributor

    @mallenexpensify I've accepted the offer, thanks!

  21. mallenexpensify commented on Jun 19, 2026

    @mallenexpensify
    Contributor

    @neerajbachani paid, summary updated above. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions