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
[$175] Expense - The DELEGATESUBMIT system message appears only after reopening the expense details #98705
Version Number: v9.4.54-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#96766 Email or phone of affected tester (no customers): n/a Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Mac 26.5.1 Safari, iPhone 13 iOS 26.5 App Component: Money Requests
Root Cause: The DELEGATESUBMIT system message is generated server-side, and it is not returned to the submitting client in the submit response (nor pushed live). It only reaches the client on the next OpenReport — which is exactly what happens when you close and reopen the expense details. This is a backend/internal issue, not an App bug.
Confidence: High (frontend traced end-to-end; the missing piece is confirmed by the App having no way to produce this action itself).
Where the fix belongs: Outside the Expensify/App repo. The command that processes the submit and creates the DELEGATESUBMIT action needs to return that report action in its response (or broadcast it to the submitting client) so it appears immediately — the same way the optimistic SUBMITTED message already does. This requires changes in an internal repository, so it should be escalated to an internal engineer with access. No App-side change is recommended.
Investigation details (App-side evidence)
The App side is working as designed — the delay is purely a data-arrival problem:
The App never builds DELEGATESUBMIT optimistically. Submitting an expense only builds an optimistic SUBMITTED action (buildOptimisticSubmittedReportAction in ReportWorkflow.ts:1335, request sent at ReportWorkflow.ts:1589). A grep of src/libs/actions/ for ACTION_DELEGATE_SUBMIT returns nothing — the action type is referenced only in render/read code.
The report list is reactive — proven by the optimistic SUBMITTED message appearing instantly. If the DELEGATESUBMIT action were in Onyx, it would render live too. So this is not an App reactivity/render bug.
Reopening re-fetches actions. Mounting the report calls openReport (ReportFetchHandler.tsx:202), which pulls the full/fresh set of report actions from the server — which by then include the DELEGATESUBMIT action. This is the "only after reopening" behavior.
Note: PR #96766 (merged 2026-08-13) only fixed the rendering/styling of this action as a muted system message — it never touched when the action arrives, consistent with the root cause above.
To confirm on the backend: for a submit where the approver has an off-policy vacation delegate, verify the submit command's response onyxData does not contain the DELEGATESUBMIT report action, while the subsequent OpenReport response does.
Possibly related:#98045 and #96454 also involve vacation-delegate system messages, though they describe wording/styling rather than this appearance-timing issue.
Next Steps for Contributor+ team: This is a backend/internal issue — the fix is outside the App repo, so it needs an internal engineer to update the submit command to return (or broadcast) the DELEGATESUBMIT action so it appears immediately. Reply with @MelvinBot <your feedback> to refine this analysis.
Reviewed and reproduced. The DELEGATESUBMIT system message is generated server-side and is not included in the submit command's response — it only reaches the client on the next OpenReport, which is why it appears only after reopening. Confirmed on the App side: there's no optimistic builder for this action (grep ACTION_DELEGATE_SUBMITsrc/libs/actions/ is empty), the required fields (originalManager/delegate/isOnPolicy) have no client-side source, and the action type is in supportedActionTypes — so if it were returned in the response it would render live like the optimistic SUBMITTED message does. This needs a backend change so the submit command returns the DELEGATESUBMIT action; no App-side fix is appropriate.
@marufsharifi I dug into this and the backend is sending the action now, the App is hiding it.
What's happening
Since Auth #23799, the SubmitReport response includes the DELEGATESUBMIT action (it's the earlier reportActions_<reportID> entry in onyxData, not the one with SUBMITTED).
That live copy has message: [{html: "", text: "", type: "COMMENT"}], because Auth has no message builder for this action. The OpenReport copy has the rendered text fragments from Web-Expensify instead.
In App, hasDeletedMessage treats message[0].html === '' as a legacy deleted comment, so isDeletedAction returns true and shouldReportActionBeVisible hides it. After OpenReport merges the text fragments, it becomes visible.
Proposed fix (App)
Add ACTION_DELEGATE_SUBMIT to the "empty message by design" exemptions in isDeletedAction in src/libs/ReportActionsUtils.ts, same as REASSIGN_APPROVER and friends. App already renders this action from originalMessage via getDelegateSubmitMessage, so message isn't needed. Fixing it in Auth instead isn't a great fit because the text is viewer-dependent (you / your / their) and live updates send one payload to every participant.
This should be a small App-only PR plus a unit test, so it can go to a contributor.
Web verification was blocked because the scenario requires multiple identities, but only one authenticated session was available. Rendering remains unverified.
Step
Status
Invite approver and submitterBlocked by the multi-identity setup requirement.
⚠️
Configure an off-workspace vacation delegateRequires access to the approver identity.
⚠️
Submit an expense as the submitterBlocked by the preceding setup.
⚠️
Verify the message appears without reopeningImmediate rendering remains unverified.
All 562 targeted tests, lint, typecheck, spelling, and Storybook smoke checks passed. Full Jest timed out; formatting verification was unavailable. Details are recorded in the PR.
changed the title [-]Expense - The DELEGATESUBMIT system message appears only after reopening the expense details[/-][+][$175] Expense - The DELEGATESUBMIT system message appears only after reopening the expense details[/+]on Nov 13, 2026
Activity
applause-bot commentedon Aug 15, 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/15d612baebe1f5ffc2aa03fc50b98c16bada0dfc55184b2ac0a572a63c318971
MelvinBot commentedon Aug 15, 2026
Issue Analysis
Root Cause: The
DELEGATESUBMITsystem message is generated server-side, and it is not returned to the submitting client in the submit response (nor pushed live). It only reaches the client on the nextOpenReport— which is exactly what happens when you close and reopen the expense details. This is a backend/internal issue, not an App bug.Confidence: High (frontend traced end-to-end; the missing piece is confirmed by the App having no way to produce this action itself).
Where the fix belongs: Outside the
Expensify/Apprepo. The command that processes the submit and creates theDELEGATESUBMITaction needs to return that report action in its response (or broadcast it to the submitting client) so it appears immediately — the same way the optimisticSUBMITTEDmessage already does. This requires changes in an internal repository, so it should be escalated to an internal engineer with access. No App-side change is recommended.Investigation details (App-side evidence)
The App side is working as designed — the delay is purely a data-arrival problem:
The App never builds
DELEGATESUBMIToptimistically. Submitting an expense only builds an optimisticSUBMITTEDaction (buildOptimisticSubmittedReportActionin ReportWorkflow.ts:1335, request sent at ReportWorkflow.ts:1589). A grep ofsrc/libs/actions/forACTION_DELEGATE_SUBMITreturns nothing — the action type is referenced only in render/read code.The action's data is server-only. Its
originalManager/delegate/isOnPolicyfields (OriginalMessage.ts:1653) have no client-side source;getDelegateSubmitMessage(ReportActionsUtils.ts:4582) only reads them.The report list is reactive — proven by the optimistic
SUBMITTEDmessage appearing instantly. If theDELEGATESUBMITaction were in Onyx, it would render live too. So this is not an App reactivity/render bug.Reopening re-fetches actions. Mounting the report calls
openReport(ReportFetchHandler.tsx:202), which pulls the full/fresh set of report actions from the server — which by then include theDELEGATESUBMITaction. This is the "only after reopening" behavior.Note: PR #96766 (merged 2026-08-13) only fixed the rendering/styling of this action as a muted system message — it never touched when the action arrives, consistent with the root cause above.
To confirm on the backend: for a submit where the approver has an off-policy vacation delegate, verify the submit command's response
onyxDatadoes not contain theDELEGATESUBMITreport action, while the subsequentOpenReportresponse does.Possibly related: #98045 and #96454 also involve vacation-delegate system messages, though they describe wording/styling rather than this appearance-timing issue.
Next Steps for Contributor+ team: This is a backend/internal issue — the fix is outside the App repo, so it needs an internal engineer to update the submit command to return (or broadcast) the
DELEGATESUBMITaction so it appears immediately. Reply with@MelvinBot <your feedback>to refine this analysis.melvin-bot commentedon Aug 15, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @marufsharifi (
External)melvin-bot commentedon Aug 15, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022088503320298759125
marufsharifi commentedon Aug 17, 2026
reproduced, reviewing the proposal
marufsharifi commentedon Aug 18, 2026
Reviewed and reproduced. The
DELEGATESUBMITsystem message is generated server-side and is not included in the submit command's response — it only reaches the client on the nextOpenReport, which is why it appears only after reopening. Confirmed on the App side: there's no optimistic builder for this action (grepACTION_DELEGATE_SUBMITsrc/libs/actions/is empty), the required fields(originalManager/delegate/isOnPolicy)have no client-side source, and the action type is in supportedActionTypes — so if it were returned in the response it would render live like the optimistic SUBMITTED message does. This needs a backend change so the submit command returns theDELEGATESUBMITaction; no App-side fix is appropriate.repro.mp4
marufsharifi commentedon Aug 18, 2026
Based on my investigation above, it looks like we need some help from the backend team.
🎀 👀 🎀 C+ reviewed
melvin-bot commentedon Aug 18, 2026
Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
stitesExpensify commentedon Aug 18, 2026
@marufsharifi just added you to a backend PR
stitesExpensify commentedon Aug 18, 2026
JK, sorry I thought you were also a backend contributor. I put up a PR and add an internal reviewer
33 remaining items
stitesExpensify commentedon Nov 10, 2026
Written by Claude on behalf of @stitesExpensify.
@marufsharifi I dug into this and the backend is sending the action now, the App is hiding it.
What's happening
SubmitReportresponse includes theDELEGATESUBMITaction (it's the earlierreportActions_<reportID>entry inonyxData, not the one withSUBMITTED).message: [{html: "", text: "", type: "COMMENT"}], because Auth has no message builder for this action. TheOpenReportcopy has the rendered text fragments from Web-Expensify instead.hasDeletedMessagetreatsmessage[0].html === ''as a legacy deleted comment, soisDeletedActionreturns true andshouldReportActionBeVisiblehides it. AfterOpenReportmerges the text fragments, it becomes visible.Proposed fix (App)
Add
ACTION_DELEGATE_SUBMITto the "empty message by design" exemptions inisDeletedActioninsrc/libs/ReportActionsUtils.ts, same asREASSIGN_APPROVERand friends. App already renders this action fromoriginalMessageviagetDelegateSubmitMessage, somessageisn't needed. Fixing it in Auth instead isn't a great fit because the text is viewer-dependent (you / your / their) and live updates send one payload to every participant.This should be a small App-only PR plus a unit test, so it can go to a contributor.
marufsharifi commentedon Nov 11, 2026
@MelvinBot implement this: #98705 (comment)
MelvinBot commentedon Nov 11, 2026
🤖 Web test steps verification results:⚠️ partial
Web verification was blocked because the scenario requires multiple identities, but only one authenticated session was available. Rendering remains unverified.
Invite approver and submitter
Blocked by the multi-identity setup requirement.Configure an off-workspace vacation delegate
Requires access to the approver identity.Submit an expense as the submitter
Blocked by the preceding setup.Verify the message appears without reopening
Immediate rendering remains unverified.Implemented in draft PR: Show delegate submit system messages without reopening expense details, assigned to
marufsharifi.All 562 targeted tests, lint, typecheck, spelling, and Storybook smoke checks passed. Full Jest timed out; formatting verification was unavailable. Details are recorded in the PR.
view run
melvin-bot commentedon Nov 13, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (
External)[-]Expense - The DELEGATESUBMIT system message appears only after reopening the expense details[/-][+][$175] Expense - The DELEGATESUBMIT system message appears only after reopening the expense details[/+]mallenexpensify commentedon Nov 13, 2026
Claude posting on behalf of Matt:
@Pujan92 please take over as C+.