Skip to content

[Due for payment 2026-06-24] [$250] Agents - Add rule RHP opens after returning from Agents link in confirm modal #93618

Closed

Description

@applause-bot

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: 9.4.8-0
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: #93466
Email or phone of affected tester (no customers): oidjnoisdjoisjiosjdio@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Enable Rules in workspace settings.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Rules.
  3. Click Add Agent rule.
  4. Enter anything > Save.
  5. On the confirm modal, click Account > Agents.
  6. Click browser back button.

Expected Result:

Add rule RHP will not open after returning from Agents link in confirm modal.

Actual Result:

Add rule RHP opens after returning from Agents link in confirm modal.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7181527_1781548567375.4.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Nathan Lemma
Bug ID: 7181527

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

Activity

  1. applause-bot commented on Jun 15, 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/841e67fa57c5cb408a1f8a1490116e390c0702522933662e9f8a8bf68bf7ec0c

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 15, 2026
  3. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #93466

  4. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Jun 15, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jun 15, 2026
  7. NicolasBonet commented on Jun 15, 2026

    @NicolasBonet
    Contributor

    Not a blocker, @MelvinBot investigate why the modal is still open after going back.

  8. MelvinBot commented on Jun 15, 2026

    @MelvinBot
    Contributor

    Proposal

    This is a regression introduced by #93466 (the PR linked on this deploy blocker), in AddAgentRulePage.tsx.

    What is the root cause of that problem?

    When the "Account > Agents" link in the confirm modal is pressed, the modal closes and this runs:

    Navigation.goBack();
    if (linkPressedRef.current) {
        Navigation.navigate(ROUTES.SETTINGS_AGENTS);
    }
    

    goBack() and navigate() both dispatch synchronously in the same tick (default runImmediately), so navigate is not queued behind goBack. Because the top of the stack is still the RHP when navigate runs, linkTo rewrites the NAVIGATE action to a PUSH. The net browser history becomes …/rules → …/rules/agent/new (RHP) → settings/agents, so pressing browser Back re-opens the Add Agent Rule RHP instead of returning to Rules.

    Evidence

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

    In the .then() callback of saveRule, dismiss the RHP and then navigate, instead of goBack() + synchronous navigate(). Use the established "dismiss RHP → go to a central settings route" pattern, Navigation.dismissModal({afterTransition}), which pops the entire RHP from history cleanly and chains the navigate via waitForUpcomingTransition: true:

    • If the Agents link was pressed → Navigation.dismissModal({afterTransition: () => Navigation.navigate(ROUTES.SETTINGS_AGENTS)})
    • Otherwise ("Got it") → Navigation.goBack() as today.

    This same idiom is already used for RHP→settings navigation in WorkspaceInviteMessageComponent.tsx:203-205 and WorkspaceOwnerRestrictedAction/index.tsx:24-25.

    What alternative solutions did you explore? (Optional)

    Navigation.goBack(ROUTES.SETTINGS_AGENTS) (the backToRoute form) also avoids the extra PUSH by popping up to a specific route rather than pushing on top of the RHP. dismissModal is preferred since it matches the existing convention for this exact case.


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

  9. 22 remaining items

  10. melvin-bot commented on Jun 22, 2026

    @melvin-bot

    @aimane-chnaif Huh... This is 4 days overdue. Who can take care of this?

  11. melvin-bot commented on Jun 23, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  12. mallenexpensify commented on Jun 26, 2026

    @mallenexpensify
    Contributor

    @MelvinBot payment is due on this issue. Review the above regressions/deploy blockers related to the PR for this issue to determine how much is due. Return a bulleted list of offending PRs and mention if their associated/linked GH issue was paid. Payment details are in https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md. include proposed payment details in the below format

    Payment Summary

    Contributor: @user paid $250 via Upwork
    Contributor+: @user due $250 via NewDot

  13. mallenexpensify commented on Jun 26, 2026

    @mallenexpensify
    Contributor

    @aimane-chnaif once Melv is finished above, please comment on DBs. From the C+ doc

    If there are posts on the PR or issue that reference a regression or deploy blocker, C+ posts on the issue and confirms regression (which will reduce pay by 50%) or provides reasoning why they shouldn’t be considered. If the C+ doesn’t update the issue, the contributor manager making the payment will assume any mention of a regression or deploy blockers reduces the issue amount.

  14. MelvinBot commented on Jun 26, 2026

    @MelvinBot
    Contributor

    No regression/deploy-blocker reduction applies — full payment is due.

    This issue is itself the deploy blocker (a regression from #93466), and it was fixed by #93620. The relevant question for payment is whether the fix PR (#93620) introduced any new regression/deploy blocker that would cut pay by 50%. It did not.

    Offending PRs (regressions caused by the fix)

    • None. PR Dismiss agent rule RHP before navigating to Agents page #93620 has no deploy-blocker or regression issues filed against it (its only cross-references are this issue and an unrelated internal Melvin tracking issue). The fix shipped in 9.4.9-0, completed its 7-day regression window, and no regressions were reported. So there is no 50% reduction on this issue.

    Notes on roles

    Payment Summary

    Contributor: NicolasBonet — N/A (Expensify employee, no payment due)
    Contributor+: aimane-chnaif due $250 via Upwork (automatic offer already sent)

  15. aimane-chnaif commented on Jun 26, 2026

    @aimane-chnaif
    Contributor

    We can close this as follow-up of #93448.
    More context: #93448 (comment)

  16. mallenexpensify commented on Jun 26, 2026

    @mallenexpensify
    Contributor

    Closing, payment will happen on parent issue

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions