Skip to content

[$250] Workflows - Not here page opens after changing approver and returning from Expenses from #93729

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-2
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #80449
Email or phone of affected tester (no customers): sdjonisdjosdijodsjo@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:

  • Invite User A and B to the workspace.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Workflows.
  3. Click Add approval workflow.
  4. Create a workflow where User A submits to User B.
  5. Open the created workflow.
  6. Change the approver to User A.
  7. Click Expenses from.
  8. Click RHP back button.

Expected Result:

App will return to confirm page.

Actual Result:

Not here page opens after changing approver and returning from Expenses from.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7182590_1781626889618.20260617_001828.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7182590

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

Activity

  1. applause-bot commented on Jun 16, 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/bce55871af6c191383aa2795dea7343867bde053b6200a629e144afa736f9d0a

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

    @melvin-bot

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

  4. melvin-bot commented on Jun 16, 2026

    @melvin-bot

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

  5. github-actions commented on Jun 16, 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. MelvinBot commented on Jun 16, 2026

    @MelvinBot
    Contributor

    Proposal

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

    On an existing approval workflow, after changing the approver and opening Expenses from, pressing the RHP back button shows the "Not here" (full‑page not‑found) view instead of returning to the workflow edit page. Regressed by #80449 (deploy blocker).

    What is the root cause of that problem?

    When you open "Expenses from" from the edit page, handleExpensesFromPress builds the backTo route keyed by the current (mutated) draft approver:

    const firstApproverEmail = approvalWorkflow.approvers?.at(0)?.email ?? '';
    const backTo = ... ROUTES.WORKSPACE_WORKFLOWS_APPROVALS_EDIT.getRoute(policyID, firstApproverEmail) ...

    The WORKSPACE_WORKFLOWS_APPROVALS_EDIT page resolves the workflow by matching firstApproverEmail against the persisted policy.employeeList (EditPage:88‑101), and renders NotFound when no match is found (!currentApprovalWorkflow).

    After step 6 (change approver from User B → User A), the draft approvers[0] is User A, but the change hasn't been saved — the persisted workflow is still keyed by User B. So backTo points at .../edit/userA, which has no matching persisted workflow → "Not here". Changing the approver is exactly what makes the draft approver diverge from the persisted one, which is why that step is required to reproduce.

    The companion goBack in the ExpensesFrom page already does this correctly, keying off approvalWorkflow.originalApprovers[0].email — the editor was left using the mutated approvers instead.

    Why originalApprovers is the right key

    originalApprovers is a snapshot set once in selectApprovalWorkflowForEdit (originalApprovers: workflow.approvers) and is never touched by setApprovalWorkflowApprover, so it always reflects the persisted first approver that the EDIT route lookup expects.

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

    In ApprovalWorkflowEditor.tsx handleExpensesFromPress, key the EDIT backTo off the persisted approver instead of the draft:

    const firstApproverEmail = approvalWorkflow.originalApprovers?.at(0)?.email ?? '';

    and update the useCallback dependency array accordingly (approvalWorkflow.originalApprovers instead of approvalWorkflow.approvers). This matches the ExpensesFrom goBack logic and ensures the backTo route always resolves to the persisted workflow.

    What alternative solutions did you explore?

    • Adding a loading guard around !currentApprovalWorkflow in shouldShowNotFoundView. Rejected — the lookup correctly returns nothing here (the keyed workflow genuinely doesn't exist), so this would only mask the wrong route, not fix it.

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

  7. puneetlath commented on Jun 16, 2026

    @puneetlath
    Contributor

    @MelvinBot implement this.

  8. MelvinBot commented on Jun 16, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #93733
    Please mark it as "Ready for review" when it is ready for review.

  9. 18 remaining items

  10. melvin-bot commented on Jun 25, 2026

    @melvin-bot

    @situchan Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  11. melvin-bot commented on Jun 29, 2026

    @melvin-bot

    @situchan 12 days overdue. Walking. Toward. The. Light...

  12. melvin-bot commented on Jul 2, 2026

    @melvin-bot

    This issue has not been updated in over 14 days. @youssef-lr, @situchan eroding to Weekly issue.

  13. situchan commented on Jul 9, 2026

    @situchan
    Contributor

    C+ payment is pending for PR review
    cc: @mallenexpensify

  14. changed the title [-][Due for payment 2026-06-24] [Due for payment 2026-06-23] [$250] Workflows - Not here page opens after changing approver and returning from Expenses from[/-] [+][$250] Workflows - Not here page opens after changing approver and returning from Expenses from[/+] on Jul 9, 2026
  15. mallenexpensify commented on Jul 9, 2026

    @mallenexpensify
    Contributor

    Please comment and tag me if/when payment is due, thx

  16. situchan commented on Jul 9, 2026

    @situchan
    Contributor

    BugZero Checklist:

    Regression Test Proposal

    Test:

    1. Invite User A and User B to a workspace.
    2. Go to Workspace settings > Workflows > Add approval workflow. Create a workflow where User A submits to User B.
    3. Open the created workflow.
    4. Change the approver to User A.
    5. Click Expenses from.
    6. Click the RHP back button.
    7. Verify the app returns to the workflow confirm/edit page (NOT the "Not here" page).
    8. Repeat without changing the approver and verify back navigation still returns to the confirm page.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-28b9-a73b-8825-8963c4857644
  17. situchan commented on Jul 9, 2026

    @situchan
    Contributor

    Please comment and tag me if/when payment is due, thx

    @mallenexpensify Payment is due

  18. mallenexpensify commented on Jul 9, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @situchan due $250 via NewDot

    ^ Test case created. Thx

  19. laurenreidexpensify commented on Jul 20, 2026

    @laurenreidexpensify
    Contributor

    $250 approved for @situchan

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.EngineeringSkip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.WeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions