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
Next step message displayed as "... for admin" then changed to "... for you to pay #97758
Version Number: v9.4.49-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:#97117 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 / Chrome, iPhone 13 / iOS 27 Beta, Samsung Galaxy A52 / Android 14 App Component: Chat Report View
Action Performed:
Preconditions: create a new account and create a workspace, create an expense in the workspace
Steps:
Navigate to spends -> open the expense report that shows the next-step status bar in the report header.
Submit then approve the expense while observing the next step in report header
Expected Result:
after approving the expense, the next-step status should displayed as "waiting for you to pay the expense" and doesn't changed to any other state because user is the admin/owner of the workspace.
Actual Result:
after approving the expense, the next-step status displayed as "waiting for an admin to pay the expense" briefly then changed to "waiting for you to pay the expense"
The optimistic next-step built when a report is approved uses the workspace reimburser as the payer actor, but on a brand-new workspace no reimburser/bank account is configured yet, so that ID resolves to -1. -1 renders as the generic "an admin". The message only flips to "you" once Auth responds with the real next step (which knows the actual payer).
Chain:
On approve, the optimistic APPROVED next step sets actorAccountID: reimburserAccountID — NextStepUtils.ts:275-279.
getReimburserAccountID returns -1 when policy.achAccount.reimburser is empty — true for a fresh workspace with no bank account (matches the repro preconditions).
When the server's nextStep arrives with the real payer (the owner/current user), it re-renders as "you" — producing the brief flicker.
Why the current user is the payer here
The APPROVED branch is only reached after the !isPayer(...) guard at NextStepUtils.ts:269, so at line 275 the current user is already known to be a payer. The optimistic code just fails to reflect that when there's no configured reimburser — it falls back to -1 ("an admin") rather than the owner/current user.
What changes do you think we should make in order to solve the problem?
In the optimistic APPROVED branch (NextStepUtils.ts:278), when reimburserAccountID is -1, fall back to the actual payer (the policy owner) instead of leaving it -1. This mirrors what the sibling nextStepFixOrPayExpense already does, where the pay actor is policy?.ownerAccountID ?? -1 (NextStepUtils.ts:120-125). With that, the optimistic message shows "you" immediately for the owner, matching what the server returns and eliminating the flicker.
What alternative solutions did you explore? (Optional)
Suppress rendering until the server next step arrives — rejected, as it would delay the next-step message for all approvals and hurt the offline-first experience. Fixing the optimistic actor is the smaller, more consistent change.
Confidence: Medium-High — the code chain fully explains the exact "an admin" → "you" transition and the "new workspace / no bank account" repro preconditions. I did not runtime-verify the transient frame.
Possibly related:#81678 (next-step pay/bank-account message) — same next-step-payer area, different symptom.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/97758) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
@NicolasBonet@dukenv0307@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!
Created the backend issue and assigned you: Expensify/Expensify#673088
It captures the OpenReport vs OpenPolicyWorkflowsPageachAccount inconsistency identified here and confirmed as a BE issue here, and links back to this issue for context.
Activity
applause-bot commentedon Aug 4, 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/ad70e4a6504653910830114f5e78d7f44e1099d226859a22d5f020b9b2c9b8ab
MelvinBot commentedon Aug 4, 2026
Proposal
What is the root cause of that problem?
The optimistic next-step built when a report is approved uses the workspace reimburser as the payer actor, but on a brand-new workspace no reimburser/bank account is configured yet, so that ID resolves to
-1.-1renders as the generic "an admin". The message only flips to "you" once Auth responds with the real next step (which knows the actual payer).Chain:
actorAccountID: reimburserAccountID—NextStepUtils.ts:275-279.getReimburserAccountIDreturns-1whenpolicy.achAccount.reimburseris empty — true for a fresh workspace with no bank account (matches the repro preconditions).buildNextStepMessagemapsactorAccountID === -1toUNSPECIFIED_ADMIN.nextSteparrives with the real payer (the owner/current user), it re-renders as "you" — producing the brief flicker.Why the current user is the payer here
The APPROVED branch is only reached after the
!isPayer(...)guard atNextStepUtils.ts:269, so at line 275 the current user is already known to be a payer. The optimistic code just fails to reflect that when there's no configured reimburser — it falls back to-1("an admin") rather than the owner/current user.What changes do you think we should make in order to solve the problem?
In the optimistic APPROVED branch (
NextStepUtils.ts:278), whenreimburserAccountIDis-1, fall back to the actual payer (the policy owner) instead of leaving it-1. This mirrors what the siblingnextStepFixOrPayExpensealready does, where the pay actor ispolicy?.ownerAccountID ?? -1(NextStepUtils.ts:120-125). With that, the optimistic message shows "you" immediately for the owner, matching what the server returns and eliminating the flicker.What alternative solutions did you explore? (Optional)
Suppress rendering until the server next step arrives — rejected, as it would delay the next-step message for all approvals and hurt the offline-first experience. Fixing the optimistic actor is the smaller, more consistent change.
Confidence: Medium-High — the code chain fully explains the exact "an admin" → "you" transition and the "new workspace / no bank account" repro preconditions. I did not runtime-verify the transient frame.
Possibly related: #81678 (next-step pay/bank-account message) — same next-step-payer area, different symptom.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/97758)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
melvin-bot commentedon Aug 4, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @gijoe0295 (
External)melvin-bot commentedon Aug 4, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022084500993126765438
j3ffffff commentedon Aug 4, 2026
nkdengineer commentedon Aug 5, 2026
There is inconsistent data between
OpenReportandOpenPolicyWorkflowsPage.When we create the workspace and don't change the
reimburser:OpenReportreturnsachAccountasnull.OpenPolicyWorkflowsPagereturnsreimburserinachAccountas owner.So maybe we can fix this from the backend site.
Or we need to update
getReimburserAccountIDto fall back to the policy's owner if payment is enabled andpolicy?.achAccountisundefined.melvin-bot commentedon Aug 7, 2026
@gijoe0295 Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Aug 11, 2026
@gijoe0295 Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Aug 13, 2026
@gijoe0295 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
gijoe0295 commentedon Aug 17, 2026
Thank you @nkdengineer. I agree with him here that this is a backend issue due to missing
policy.achAccount.reimburserinOpenReport.🎀 👀 🎀 C+ reviewed
melvin-bot commentedon Aug 17, 2026
Triggered auto assignment to @NicolasBonet, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
dukenv0307 commentedon Aug 17, 2026
I'll take a look
melvin-bot commentedon Aug 18, 2026
@NicolasBonet @dukenv0307 @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!
dukenv0307 commentedon Aug 19, 2026
@MelvinBot Let's create the BE issue in Expensify/Expensify then assign me
MelvinBot commentedon Aug 19, 2026
Created the backend issue and assigned you: Expensify/Expensify#673088
It captures the
OpenReportvsOpenPolicyWorkflowsPageachAccountinconsistency identified here and confirmed as a BE issue here, and links back to this issue for context.dukenv0307 commentedon Aug 24, 2026
Fixed
Screen.Recording.2026-08-24.at.09.18.21.mov