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-09-18] [$250] [Exploratory] Agents - "Add Agent" leads to "It´s not here" page when clicked after creating first agent. #93272
Version Number: 9.4.5-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#92286 Email or phone of affected tester (no customers):applausetester+ib0005@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome App Component: Workspace Settings
Action Performed:
Prerequisite: Use an expensifail account.
Prerequisite 2: Account has a workspace with "Approvals" enabled.
Prerequisite 3: No agents created yet.
Open the staging.new.expensify.com website.
Navigate to "Workspaces" > Workspace > "Workflows"
Scroll down to "Approvals"
Click on "Add Agent" > "Create Agent" > "Save"
Click on "Add Agent" again.
Note that you are redirected to a "It´s not here" page.
Expected Result:
User should be able to create a second agent via "Add Agent" button on workflows page.
Actual Result:
After creating first agent via "Add Agent" button on "Approvals", clicking on it again redirects to a "It´s not here" page.
TL;DR: This is a stale navigation bug in the "Add agent" → Approvals workflow flow. The code that caused it has since been substantially refactored, and the specific broken navigation no longer exists on current main (v9.4.36-1). This most likely no longer reproduces — it should be re-verified on current staging before any code work.
Historical root cause (as of the reported build, v9.4.5-0): After you created your first agent from the Approvals "Add agent" button, the workflow card's first approver briefly had a blank email during the optimistic-save window (the agent row is written to Onyx before CREATE_AGENT responds). The second "Add agent" click derived its navigation target from that blank email and pushed the Approvals Edit screen with an empty firstApproverEmail. That screen resolves the workflow by matching firstApproverEmail, finds none, and renders the FullPageNotFoundView — the "It´s not here" page.
Why it looks resolved now: On current main, AddAgentPage simply calls createAgent(...) then Navigation.goBack() — it no longer navigates into the Approvals Edit screen with a seeded (possibly-empty) approver email. The dedicated hooks that produced the broken navigation (useAddAgentToApprovalWorkflow, useDeferredAgentWorkflowReconciliation) have been removed, and every remaining caller of the Edit route passes a real, user-selected approver email rather than the optimistic seed.
Investigation details & evidence
Reported build: v9.4.5-0 (2026-06-11). Current main: v9.4.36-1 (SHA e4ae3a2). The agent-approver feature has been heavily reworked in between.
The NotFound trigger is the !currentApprovalWorkflow branch of the Edit page's not-found guard: with an empty firstApproverEmail, no workflow matches approvers[0].email, so currentApprovalWorkflow is undefined.
Current main no longer contains the buggy hooks or an "Add agent" card handler that reads the overlaid (blank-email) workflow. Stale comments referencing the "Add agent" seed flow remain in WorkspaceWorkflowsApprovalsApproverPage.tsx / ApprovalWorkflowEditor.tsx, but the code path that navigated to the Edit screen with an empty email is gone.
Alternative I couldn't fully rule out without runtime testing: the "Add agent" entry point may now surface through a different UI path (e.g. the approver selection list) whose empty-state handling I couldn't exercise here. That's exactly why a quick re-test on current staging is the right next step.
Recommended next step: Re-run the exact repro on current staging (Workspace → Workflows → Approvals → Add agent → Create Agent → Save → Add agent again). If it no longer lands on the "It´s not here" page, this can be closed as resolved by the refactor. If it does still reproduce, capture the URL you land on (specifically whether the firstApproverEmail path segment is empty) so the residual entry point can be pinned down.
Possibly related agent bugs from the same feature area:#93262 (RHP → "It´s not here" after deleting an agent offline), #93266 (previous approver still shown after adding agent).
⚠️ Confidence: Medium. The code evidence strongly indicates the reported path was refactored away, but I could not run staging to confirm the bug no longer reproduces.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis, or re-verify on staging per above.
Please re-state the problem that we are trying to solve in this issue.
On a workspace with Approvals enabled, after creating the first agent through Workflows > Approvals > "Add Agent" > "Create Agent" > "Save", clicking "Add Agent" a second time navigates to the "Hmm... it's not here" not-found page instead of opening the approver edit screen so a second agent can be added.
What is the root cause of that problem?
When an agent is created from the Workflows page while the CREATE_AGENT request is still in flight, the just-saved workflow is stashed as a deferred save and overlaid back onto the workflows list. During that overlay the workflow's approvers[0] becomes the pending agent, whose email is an empty placeholder until the server resolves the real identity. To keep routing stable through this transient state, each workflow is given a separate routingFirstApproverEmail field that always holds the original (pre-overlay) first-approver email.
This overlay and the stable routing key are produced here:
Every navigation path on the Workflows page that has to identify a workflow uses that stable routingFirstApproverEmail — the list key, the "edit approvers" route, the raw-workflow lookup, and the clear-pending-agent action:
The "Add Agent" handler is the one path that was not migrated to the stable key. It still derives the approver email from the live (overlaid) approvers[0]:
After the first agent is created, workflow.approvers.at(0)?.email resolves to the empty placeholder of the pending agent (not the original first approver). That empty/incorrect value is then passed as firstApproverEmail when navigating to the approver edit screen.
The edit screen looks the workflow up by matching firstApproverEmail against the raw (non-overlaid) workflow's approvers[0].email, which still holds the original approver email. With the wrong value handed in, the lookup returns nothing, currentApprovalWorkflow is undefined, and shouldShowNotFoundView becomes true — rendering the not-found page:
What changes do you think we should make in order to solve the problem?
Make the "Add Agent" handler use the same stable routing key that every other navigation path on the Workflows page already uses, instead of reading the live overlaid approvers[0] email.
In src/hooks/useAddAgentToApprovalWorkflow.ts, change the handler so the value it sends as firstApproverEmail (the workflowApproverEmail it computes near the top of the returned handler and passes to both WORKSPACE_WORKFLOWS_ADD_AGENT and WORKSPACE_WORKFLOWS_APPROVALS_EDIT) comes from workflow.routingFirstApproverEmail rather than from workflow.approvers.at(0)?.email. Because the caller already passes the overlaid workflow object (which carries routingFirstApproverEmail), the handler's parameter type should be widened to the reconciled workflow type that includes that field (the ApprovalWorkflow & { routingFirstApproverEmail: string } shape returned by useDeferredAgentWorkflowReconciliation).
With this change, the second "Add Agent" click navigates to the approver edit screen with the original first-approver email, the lookup succeeds, and the user can add the second agent — matching the behavior of the existing Edit and clear-pending-agent paths.
What alternative solutions did you explore? (Optional)
Falling back to routingFirstApproverEmail only when approvers.at(0)?.email is empty (e.g. workflow.approvers.at(0)?.email || workflow.routingFirstApproverEmail). This works but keeps two sources of truth for the same routing decision; using routingFirstApproverEmail consistently — as the rest of the Workflows page already does — is cleaner and avoids re-introducing the same class of bug if the overlay ever changes approvers[0] to a non-empty but reordered value.
My understanding is that @nabi-ebrahimi was hired, raised the PR, completed tests and addressed feedback, then we wanted to hold on the PR. @NicolasBonet raised a different PR, @marufsharifi reviewed that one and then we closed @nabi-ebrahimi 's PR. If so, this would be due 100% to @nabi-ebrahimi (cuz they did the work we initially hired them for)
Activity
applause-bot commentedon Jun 11, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/6e1a3e60b12f099ce6bae97f30e927f21eac62a4d0803e6b94fdd74450adf324
MelvinBot commentedon Jul 17, 2026
Issue Analysis
TL;DR: This is a stale navigation bug in the "Add agent" → Approvals workflow flow. The code that caused it has since been substantially refactored, and the specific broken navigation no longer exists on current
main(v9.4.36-1). This most likely no longer reproduces — it should be re-verified on current staging before any code work.Historical root cause (as of the reported build, v9.4.5-0): After you created your first agent from the Approvals "Add agent" button, the workflow card's first approver briefly had a blank email during the optimistic-save window (the agent row is written to Onyx before
CREATE_AGENTresponds). The second "Add agent" click derived its navigation target from that blank email and pushed the Approvals Edit screen with an emptyfirstApproverEmail. That screen resolves the workflow by matchingfirstApproverEmail, finds none, and renders theFullPageNotFoundView— the "It´s not here" page.Why it looks resolved now: On current
main,AddAgentPagesimply callscreateAgent(...)thenNavigation.goBack()— it no longer navigates into the Approvals Edit screen with a seeded (possibly-empty) approver email. The dedicated hooks that produced the broken navigation (useAddAgentToApprovalWorkflow,useDeferredAgentWorkflowReconciliation) have been removed, and every remaining caller of the Edit route passes a real, user-selected approver email rather than the optimistic seed.Investigation details & evidence
main: v9.4.36-1 (SHAe4ae3a2). The agent-approver feature has been heavily reworked in between.!currentApprovalWorkflowbranch of the Edit page's not-found guard: with an emptyfirstApproverEmail, no workflow matchesapprovers[0].email, socurrentApprovalWorkflowisundefined.mainno longer contains the buggy hooks or an "Add agent" card handler that reads the overlaid (blank-email) workflow. Stale comments referencing the "Add agent" seed flow remain inWorkspaceWorkflowsApprovalsApproverPage.tsx/ApprovalWorkflowEditor.tsx, but the code path that navigated to the Edit screen with an empty email is gone.Recommended next step: Re-run the exact repro on current staging (Workspace → Workflows → Approvals → Add agent → Create Agent → Save → Add agent again). If it no longer lands on the "It´s not here" page, this can be closed as resolved by the refactor. If it does still reproduce, capture the URL you land on (specifically whether the
firstApproverEmailpath segment is empty) so the residual entry point can be pinned down.Possibly related agent bugs from the same feature area: #93262 (RHP → "It´s not here" after deleting an agent offline), #93266 (previous approver still shown after adding agent).
Next Steps: Reply with
@MelvinBot <your feedback>to refine this analysis, or re-verify on staging per above.melvin-bot commentedon Jul 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @marufsharifi (
External)wildan-m commentedon Jul 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On a workspace with Approvals enabled, after creating the first agent through Workflows > Approvals > "Add Agent" > "Create Agent" > "Save", clicking "Add Agent" a second time navigates to the "Hmm... it's not here" not-found page instead of opening the approver edit screen so a second agent can be added.
What is the root cause of that problem?
When an agent is created from the Workflows page while the
CREATE_AGENTrequest is still in flight, the just-saved workflow is stashed as a deferred save and overlaid back onto the workflows list. During that overlay the workflow'sapprovers[0]becomes the pending agent, whoseemailis an empty placeholder until the server resolves the real identity. To keep routing stable through this transient state, each workflow is given a separateroutingFirstApproverEmailfield that always holds the original (pre-overlay) first-approver email.This overlay and the stable routing key are produced here:
App/src/hooks/useDeferredAgentWorkflowReconciliation.ts
Lines 39 to 65 in 21ae026
Every navigation path on the Workflows page that has to identify a workflow uses that stable
routingFirstApproverEmail— the list key, the "edit approvers" route, the raw-workflow lookup, and the clear-pending-agent action:App/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx
Lines 512 to 549 in 21ae026
The "Add Agent" handler is the one path that was not migrated to the stable key. It still derives the approver email from the live (overlaid)
approvers[0]:App/src/hooks/useAddAgentToApprovalWorkflow.ts
Lines 52 to 92 in 21ae026
After the first agent is created,
workflow.approvers.at(0)?.emailresolves to the empty placeholder of the pending agent (not the original first approver). That empty/incorrect value is then passed asfirstApproverEmailwhen navigating to the approver edit screen.The edit screen looks the workflow up by matching
firstApproverEmailagainst the raw (non-overlaid) workflow'sapprovers[0].email, which still holds the original approver email. With the wrong value handed in, the lookup returns nothing,currentApprovalWorkflowisundefined, andshouldShowNotFoundViewbecomes true — rendering the not-found page:App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx
Lines 130 to 158 in 21ae026
What changes do you think we should make in order to solve the problem?
Make the "Add Agent" handler use the same stable routing key that every other navigation path on the Workflows page already uses, instead of reading the live overlaid
approvers[0]email.In
src/hooks/useAddAgentToApprovalWorkflow.ts, change the handler so the value it sends asfirstApproverEmail(theworkflowApproverEmailit computes near the top of the returned handler and passes to bothWORKSPACE_WORKFLOWS_ADD_AGENTandWORKSPACE_WORKFLOWS_APPROVALS_EDIT) comes fromworkflow.routingFirstApproverEmailrather than fromworkflow.approvers.at(0)?.email. Because the caller already passes the overlaid workflow object (which carriesroutingFirstApproverEmail), the handler's parameter type should be widened to the reconciled workflow type that includes that field (theApprovalWorkflow & { routingFirstApproverEmail: string }shape returned byuseDeferredAgentWorkflowReconciliation).With this change, the second "Add Agent" click navigates to the approver edit screen with the original first-approver email, the lookup succeeds, and the user can add the second agent — matching the behavior of the existing Edit and clear-pending-agent paths.
What alternative solutions did you explore? (Optional)
Falling back to
routingFirstApproverEmailonly whenapprovers.at(0)?.emailis empty (e.g.workflow.approvers.at(0)?.email || workflow.routingFirstApproverEmail). This works but keeps two sources of truth for the same routing decision; usingroutingFirstApproverEmailconsistently — as the rest of the Workflows page already does — is cleaner and avoids re-introducing the same class of bug if the overlay ever changesapprovers[0]to a non-empty but reordered value.melvin-bot commentedon Jul 17, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022078175129129610425
43 remaining items
melvin-bot commentedon Sep 17, 2026
Payment Summary
Resolving PRs:
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Sep 22, 2026
Payment Summary
Contributor: @nabi-ebrahimi paid $250 via Upwork
Contributor+: @marufsharifi paid $250 via Upwork
@nabi-ebrahimi can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022102485958747266978
My understanding is that @nabi-ebrahimi was hired, raised the PR, completed tests and addressed feedback, then we wanted to hold on the PR. @NicolasBonet raised a different PR, @marufsharifi reviewed that one and then we closed @nabi-ebrahimi 's PR. If so, this would be due 100% to @nabi-ebrahimi (cuz they did the work we initially hired them for)
marufsharifi commentedon Sep 23, 2026
@mallenexpensify, I haven’t received an offer for this yet. Could you please check again when you have a chance? Thanks!
nabi-ebrahimi commentedon Sep 23, 2026
@mallenexpensify, Accepted the offer. thx.
mallenexpensify commentedon Sep 24, 2026
@marufsharifi can you please accept the job below? Please reply here and tag me once you have. It was my mistake
https://www.upwork.com/jobs/~022103200985655547912
marufsharifi commentedon Sep 24, 2026
@mallenexpensify, I've accepted the offer. thanks.
mallenexpensify commentedon Sep 24, 2026
@marufsharifi I messed something up, can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022102485958747266978
marufsharifi commentedon Sep 24, 2026
@mallenexpensify, I've accepted the new job. thanks.
mallenexpensify commentedon Sep 24, 2026
@marufsharifi paid, summary updated above. Thx for the patience