Skip to content

[$175] Trial ended-User is not navigated to Subscription page after clicking Add payment card #105225

Open

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.5.24-2
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/tc/TC-4272
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: MacBook Air 26.6.2 Chrome
App Component: Other

Action Performed:

  1. Log in to ND with the account that has a free trial
  2. Disable the internet connection
  3. Open console and enter the snippet: Onyx.merge('nvp_private_lastDayFreeTrial', '<today's date time>');
    E.g: if today's date is 8/26/2024 it would look like: Onyx.merge('nvp_private_lastDayFreeTrial', '2024-08-26 01:01:00');
  4. Then run the following snippet: "Onyx.merge('nvp_private_amountOwed', 1000);"
  5. Then run the following snippet: "Onyx.merge('nvp_private_billingGracePeriodEnd', 1719792000);"
  6. Go to the Workspace chat, click "+" - Create expense
  7. On the “Restricted” screen click “Add payment card”

Expected Result:

User is redirected to the Subscription page with the Add payment card RHP opened

Actual Result:

User is not redirected to the Subscription page. Add payment card RHP is opened in the Inbox tab

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7298452_1793153263796.Add_payment_card.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7298452

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @gijoe0295

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 28, 2026
  2. applause-bot commented on Oct 28, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/b5bdfd1644f592b7c31613bdd9337cf483c0559d60bbd7f96e02af8f0f0ce800

  3. MelvinBot commented on Oct 28, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    On web, clicking Add payment card on the workspace "Restricted" screen opens the Add payment card RHP on top of the Inbox. It should open on top of Settings > Subscription.

    What is the root cause of that problem?

    This is a regression from Keep the page an RHP was opened from underneath it, merged 2026-10-27.

    That PR made Add payment card a dynamic route. The Restricted screen's button changed from the fixed settings/subscription/add-payment-card route to createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path). See WorkspaceOwnerRestrictedAction/index.tsx:30-34.

    With no basePath, createDynamicRoute adds add-payment-card to whatever route is active (createDynamicRoute.ts:83). Here the call runs after dismissModal, so the active route is the workspace chat. The RHP then opens over the Inbox instead of Subscription.

    Keeping the chat underneath was the goal for Concierge's "Add payment card" button. It is wrong for the Restricted screen, whose job is to send the owner to Subscription.

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

    In WorkspaceOwnerRestrictedAction/index.tsx, pass Subscription as the base path: createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path, ROUTES.SETTINGS_SUBSCRIPTION.route).

    The resulting route is settings/subscription/add-payment-card, which matches the behavior before the regression. Subscription is already an allowed entry screen for this dynamic route (ROUTES.ts:248).

    Update the expected route in tests/unit/pages/RestrictedAction/WorkspaceOwnerRestrictedActionTest.tsx to match.

    What alternative solutions did you explore? (Optional)

    Navigate to Subscription first, then open the dynamic route. This takes two navigations and adds a transition for no benefit.

    Investigation details
    • Diff that changed this button: commit 4cd4df80bb (part of the PR above).
    • The native version is unaffected. It navigates to ROUTES.SETTINGS_SUBSCRIPTION directly (index.native.tsx:39). This matches the report: only MacOS Chrome/Safari is checked.
    • The other callers changed by that PR (Concierge button, Home, Teachers Unite, Subscription card section) intentionally keep their current page underneath, so leave them as they are.
    • I did not run the reproduction in a browser. The conclusion is based on the code diff and the timing of the merge versus 9.5.24-2.

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/105225) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 28, 2026
  5. melvin-bot commented on Oct 28, 2026

    @melvin-bot

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

  6. changed the title [-]Trial ended-User is not navigated to Subscription page after clicking Add payment card[/-] [+][$175] Trial ended-User is not navigated to Subscription page after clicking Add payment card[/+] on Oct 28, 2026
  7. melvin-bot commented on Oct 28, 2026

    @melvin-bot
  8. camesenin commented on Oct 28, 2026

    @camesenin
  9. melvin-bot commented on Oct 28, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  10. j3ffffff commented on Oct 28, 2026

    @j3ffffff
  11. apoorv-xs commented on Oct 28, 2026

    @apoorv-xs
  12. melvin-bot commented on Oct 28, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  13. 33 remaining items

  14. jeffrey-graham commented on Nov 7, 2026

    @jeffrey-graham
  15. melvin-bot commented on Nov 7, 2026

    @melvin-bot
  16. ujjwalmishramishra8977-cell commented on Nov 7, 2026

    @ujjwalmishramishra8977-cell

    @jeffrey-graham, I carefully reviewed the information you provided and independently identified the underlying code-level issues. I've documented the confirmed findings, their root causes, and their impact, along with the proposed corrections.

    1. Please re-state the problem that we are trying to solve in this issue.

    When a workspace owner whose trial has expired clicks the Add payment card button in the Workspace Restricted Action modal, the Add Payment Card panel opens over the Inbox/report instead of opening over Settings > Subscription.

    This causes an incorrect navigation experience and interrupts the intended billing setup workflow.

    2. What is the root cause of that problem?

    Root Cause 1: Missing explicit base path during dynamic navigation

    File:

    src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx

    The navigation currently constructs the dynamic route without specifying its intended base path:

    Navigation.dismissModal({
        afterTransition: () => Navigation.navigate(
            createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path)
        ),
    });

    File:

    src/libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute.ts

    The helper uses the following fallback:

    const routePath = basePath ?? getActiveRoute();

    Because no explicit basePath is supplied, the helper uses the currently active route.

    Consequently, the Add Payment Card route can be constructed relative to the Inbox/report route instead of Settings > Subscription.

    Impact:

    • The payment-card panel opens over the wrong background screen.
    • Users are taken into an unintended navigation context.
    • The expected Subscription billing workflow is disrupted.

    Root Cause 2: Missing Subscription RHP relationship

    File:

    src/libs/Navigation/linkingConfig/RELATIONS/SETTINGS_TO_RHP.ts

    The Subscription root relationship does not include:

    SCREENS.SETTINGS.SUBSCRIPTION.DYNAMIC_ADD_PAYMENT_CARD

    The missing relationship means the Add Payment Card dynamic screen is not explicitly registered as a child RHP of the Subscription root in this configuration.

    Impact:

    • The Subscription-to-payment-card navigation hierarchy is incomplete.
    • The expected relationship between the Subscription screen and its payment-card panel is not explicitly represented in the linking configuration.

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

    Fix 1: Supply an explicit Subscription base path

    In:

    src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx

    Change the dynamic route construction to:

    Navigation.dismissModal({
        afterTransition: () => Navigation.navigate(
            createDynamicRoute(
                DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path,
                ROUTES.SETTINGS_SUBSCRIPTION.route,
            )
        ),
    });

    This ensures that the dynamic route is constructed relative to Settings > Subscription rather than the currently active report route.

    Fix 2: Register the Add Payment Card screen in the Subscription RHP relationship

    In:

    src/libs/Navigation/linkingConfig/RELATIONS/SETTINGS_TO_RHP.ts

    Add:

    SCREENS.SETTINGS.SUBSCRIPTION.DYNAMIC_ADD_PAYMENT_CARD,

    to the relationship array for:

    SCREENS.SETTINGS.SUBSCRIPTION.ROOT

    This explicitly associates the dynamic payment-card screen with its intended Subscription parent.

    4. What alternative solutions did you explore?

    Alternative 1: Navigate to Subscription before opening Add Payment Card.

    This requires two navigation operations and an intermediate transition.

    Providing an explicit base path constructs the intended destination directly.

    Alternative 2: Change the global dynamic-route helper.

    Changing the helper's default active-route behavior could affect other callers that intentionally depend on it.

    A targeted correction in WorkspaceOwnerRestrictedAction avoids changing unrelated navigation behavior.

    5. Conclusion

    The navigation defect originates from constructing the Add Payment Card dynamic route without an explicit Subscription base path.

    The Subscription RHP relationship also lacks the corresponding dynamic screen registration.

    The proposed changes address both confirmed source-code discrepancies and align the Add Payment Card navigation with its intended Subscription context.

  17. melvin-bot commented on Nov 10, 2026

    @melvin-bot

    @gijoe0295 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  18. gijoe0295 commented on Nov 11, 2026

    @gijoe0295
    Contributor

    I'm working on it

  19. melvin-bot commented on Nov 11, 2026

    @melvin-bot

    @gijoe0295 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  20. cocvn157 commented on Nov 14, 2026

    @cocvn157

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a workspace owner's free trial has ended and they trigger a restricted workspace action (such as inviting a member or assigning a company card), clicking Add payment card on the WorkspaceOwnerRestrictedAction modal opens the Add payment card Right-Hand Panel (RHP) over the previous background screen (for example, Workspace Members) instead of navigating the underlying full-screen view to Settings > Subscription. Furthermore, pressing the back button on the Add payment card RHP returns to the previous screen instead of Settings > Subscription.

    What is the root cause of that problem?

    There are two coupled issues in how WorkspaceOwnerRestrictedAction and the settings-to-RHP relation map handle DYNAMIC_ROUTES.ADD_PAYMENT_CARD:

    1. createDynamicRoute is called without a basePath in src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx (lines 30–34):

      const addPaymentCard = () => {
          Navigation.dismissModal({
              afterTransition: () => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path)),
          });
      };

      Because no basePath is passed to createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path), createDynamicRoute (src/libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute.ts:83) falls back to getActiveRoute(). After Navigation.dismissModal finishes, the active route is whatever screen triggered the restricted-action modal (for example, workspaces/<policyID>/members), producing workspaces/<policyID>/members/add-payment-card.

      • When getMatchingFullScreenRoute (src/libs/Navigation/helpers/getMatchingFullScreenRoute.ts:227-259) strips the dynamic suffix add-payment-card, pathWithoutDynamicSuffix resolves to workspaces/<policyID>/members, keeping the Workspace Split Navigator underneath the RHP.
      • Similarly, AddPaymentCard.tsx computes backPath = useDynamicBackPath(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path), which strips add-payment-card and navigates back to workspaces/<policyID>/members instead of ROUTES.SETTINGS_SUBSCRIPTION.route.
    2. SCREENS.SETTINGS.SUBSCRIPTION.ADD_PAYMENT_CARD is missing from SETTINGS_TO_RHP[SCREENS.SETTINGS.SUBSCRIPTION.ROOT] in src/libs/Navigation/linkingConfig/RELATIONS/SETTINGS_TO_RHP.ts (lines 109–120):
      Even when createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path, ROUTES.SETTINGS_SUBSCRIPTION.route) is used (producing settings/subscription/add-payment-card), SCREENS.SETTINGS.SUBSCRIPTION.ADD_PAYMENT_CARD is registered under ModalStackNavigators (src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx), not as a dynamic suffix in DYNAMIC_ROUTES's RHP_TO_SETTINGS relation. Specifically, in getMatchingFullScreenRoute.ts:69:

      • isDynamicRouteScreen(route.name) checks whether route.name is a generated dynamic screen name, and RHP_TO_SETTINGS[route.name] (derived by inverting SETTINGS_TO_RHP) is checked at line 181.
      • Because SCREENS.SETTINGS.SUBSCRIPTION.ADD_PAYMENT_CARD is omitted from SETTINGS_TO_RHP[SCREENS.SETTINGS.SUBSCRIPTION.ROOT] (src/libs/Navigation/linkingConfig/RELATIONS/SETTINGS_TO_RHP.ts:109-120), RHP_TO_SETTINGS[SCREENS.SETTINGS.SUBSCRIPTION.ADD_PAYMENT_CARD] is undefined. As a result, linkTo / swapBackgroundTabForRHPTarget does not swap the background full-screen navigator from WorkspaceSplitNavigator to SettingsSplitNavigator (SCREENS.SETTINGS.SUBSCRIPTION.ROOT) during in-app navigation!

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

    1. Pass ROUTES.SETTINGS_SUBSCRIPTION.route as the basePath in src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx (lines 30–34):

      import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES';
      // ...
      const addPaymentCard = () => {
          Navigation.dismissModal({
              afterTransition: () => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path, ROUTES.SETTINGS_SUBSCRIPTION.route)),
          });
      };

      This sets the target URL to settings/subscription/add-payment-card, ensuring useDynamicBackPath(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path) inside AddPaymentCard.tsx resolves backPath to settings/subscription.

    2. Register SCREENS.SETTINGS.SUBSCRIPTION.ADD_PAYMENT_CARD under SCREENS.SETTINGS.SUBSCRIPTION.ROOT in src/libs/Navigation/linkingConfig/RELATIONS/SETTINGS_TO_RHP.ts (lines 109–120):

      [SCREENS.SETTINGS.SUBSCRIPTION.ROOT]: [
          SCREENS.SETTINGS.SUBSCRIPTION.ADD_PAYMENT_CARD,
          SCREENS.SETTINGS.SUBSCRIPTION.SIZE,
          SCREENS.SETTINGS.SUBSCRIPTION.EXPENSIFY_CODE,
          // ...
      ],

      This populates RHP_TO_SETTINGS[SCREENS.SETTINGS.SUBSCRIPTION.ADD_PAYMENT_CARD] = SCREENS.SETTINGS.SUBSCRIPTION.ROOT, so getMatchingFullScreenRoute (and linkTo's background full-screen synchronization) mounts the Subscription central screen in SettingsSplitNavigator directly underneath the Add payment card RHP both on in-app navigation and on deep-link/reload.

    3. Add unit/navigation test coverage:

      • Update tests/navigation/dynamicSettingsRhpBackgroundTests.ts (or WorkspaceOwnerRestrictedAction tests) to verify that navigating to createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path, ROUTES.SETTINGS_SUBSCRIPTION.route) from a workspace route mounts SCREENS.SETTINGS.SUBSCRIPTION.ROOT underneath the RHP and returns to ROUTES.SETTINGS_SUBSCRIPTION.route on back navigation.

    What alternative solutions did you explore? (Optional)

    • Using only createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path, ROUTES.SETTINGS_SUBSCRIPTION.route) without updating SETTINGS_TO_RHP.ts: While this updates the URL prefix so the header back button navigates to settings/subscription, RHP_TO_SETTINGS[SCREENS.SETTINGS.SUBSCRIPTION.ADD_PAYMENT_CARD] remains undefined, so on wide screens the background split navigator underneath the RHP does not switch to the Subscription page when opened from the Workspace Members screen. Both changes are required for consistent wide-screen and narrow-screen behavior.
  21. gijoe0295 commented on Nov 16, 2026

    @gijoe0295
    Contributor

    @MelvinBot's proposal is good. The root cause is right: since #100917, the web Restricted screen builds the dynamic route after dismissModal, so it resolves against the chat instead of Subscription. Passing ROUTES.SETTINGS_SUBSCRIPTION.route as the base path restores the behavior from before the regression and matches native.

    @MelvinBot please implement your proposal at #105225 (comment)

    🎀👀🎀 C+ reviewed

  22. expensify-chore-bot commented on Nov 16, 2026

    @expensify-chore-bot

    Triggered auto assignment to @inimaga, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  23. MelvinBot commented on Nov 16, 2026

    @MelvinBot
    Contributor

    🤖 Web test steps verification results: ⚠️ partial

    Infrastructure blocker prevented verification on dev NewDot web: the existing session was suspended and snapshots exposed no UI. No application failure was observed, and no payment card was submitted.

    Blocked browser state

    Step Status
    Log in with a free-trial workspace-owner accountAccount state could not be confirmed; the session remained suspended after one retry.
    Blocked browser state
    ⚠️
    Disable internetRequired offline fixture could not be established.
    ⚠️
    Set lastDayFreeTrial to today's datetimeCould not set or verify the value.
    ⚠️
    Set amountOwed to 1000Could not set or verify the value.
    ⚠️
    Set billingGracePeriodEnd to 1719792000Could not set or verify the value.
    ⚠️
    Workspace chat > + > Create expenseNot reached because the session exposed no UI.
    ⚠️
    Restricted > Add payment card opens over SubscriptionCould not inspect the RHP or its background.
    ⚠️
    Closing the card RHP returns to SubscriptionNot reached; no card RHP was opened.
    ⚠️

    Implemented in draft PR: Open restricted payment card flow over Subscription, assigned to gijoe0295.

    All four focused tests pass; both web regression cases fail without the fix. Lint, type checking, Storybook smoke tests, formatting, and focused compiler checks passed. Full-suite Jest and the changed-files compiler wrapper remain incomplete, documented in the PR.


    view run · no recording available

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

Metadata

Metadata

Labels

BugSomething 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