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-22] Invoice - Invoice room shows skeleton loader after sending invoice to phone number #97203
Version Number: 9.4.45-2 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#96441 Email or phone of affected tester (no customers):sdsjodijnsdojsosjio@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Mac 26.5 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Enable Invoices.
Go to staging.new.expensify.com
Open FAB > Send invoice.
Enter amount > Next.
Enter phone number that does not have Expensify account and select the user.
Send the invoice.
Expected Result:
Invoice can be sent to phone number user without issue.
Actual Result:
Invoice room shows skeleton loader after sending invoice to phone number.
⚠️Likely duplicate: This is almost certainly the same bug as #91557 — "[$250] Web - Invoice - Skeleton loading until refresh page on first time created invoice to the user" (state: Reviewing, already External with a bounty). That issue reports the identical symptom — "Invoice room displays then skeleton loading infinitely until refresh page" when sending an invoice to someone who has never received an invoice before. Picking a phone number with no Expensify account is just one reliable way to hit that "brand-new recipient" path. Recommend closing this as a duplicate of #91557 and consolidating there.
The analysis below is provided in case it's useful for #91557.
What is the root cause of that problem?
Sending an invoice to a recipient who has no existing invoice room creates a brand-new optimistic invoice room (type: CHAT, chatType: INVOICE, reportMetadata.isOptimisticReport: true).
ReportFetchHandler deliberately skips the openReport() call for optimistic CHAT-type reports that aren't policy expense chats — which is exactly the shape of a new invoice room (ReportFetchHandler.tsx:157). openReport() is the only thing that writes the report loading state and clears isLoadingInitialReportActions. Because it's skipped, that flag keeps its default of true, and the report-actions skeleton gate stays on forever.
When SendInvoice succeeds and flips isOptimisticReport to false, openReport is never retried, because the effect that triggers fetchReport() does not depend on isOptimisticReport (ReportFetchHandler.tsx:364-370). Only a page refresh remounts the screen — by then the room is no longer optimistic, so openReport finally runs and the skeleton resolves. That's the "until refresh" behavior.
Existing recipients work because their invoice room already exists in Onyx (not optimistic), so openReport runs normally on first load.
What changes do you think we should make in order to solve the problem?
Make ReportFetchHandler re-run openReport once the optimistic invoice room reconciles into a real report. The minimal fix is to add reportMetadata.isOptimisticReport to the fetchReport() effect's dependency array at ReportFetchHandler.tsx:370. The guard still correctly skips openReport while the room is optimistic (server doesn't know it yet), then re-fires once SendInvoice's response flips the flag to false, clearing the skeleton without a refresh.
What alternative solutions did you explore? (Optional)
Narrow the skip-guard at ReportFetchHandler.tsx:157 so invoice chat rooms (chatType === INVOICE) aren't treated like plain optimistic chats. This is riskier — an early openReport for a not-yet-persisted room could 404 — so the dependency-array fix is preferred.
Investigation details & evidence
Not a regression from the QA-referenced PR (#96441). That PR only swapped formatPhoneNumber from a module import to the useLocalize() context. The two implementations are byte-equivalent (same Onyx COUNTRY_CODE key, same ?? 1 default, neither returns undefined), both live callers pass a defined formatPhoneNumber, and the optimistic-report/navigation logic in SendInvoice.ts was untouched. The bug was found during that PR's QA regression pass, not caused by it — consistent with #91557 predating the PR (reported on v9.3.80-0).
Why it's not phone-specific: the code distinguishes "existing invoice room" vs "new optimistic room", not phone vs email. A brand-new email recipient with no prior invoice room should reproduce the same skeleton. Phone-number-with-no-account is simply a dependable way to force a new room.
Ruled out: reportID mismatch (navigated room ID matches the built optimistic room ID) and a DEFAULT_NUMBER_ID fallback (a no-account phone contact still gets a real deterministic optimistic accountID via generateAccountID).
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/97203) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Hey @Krishna2323 — I dug into this and wanted to share findings before posting a full proposal.
MelvinBot flagged this as a likely duplicate of #91557. The skeleton symptom is similar, but I don’t think we should close this as a duplicate of the selected #91557 proposal. That fix seeds loading state on failure so the error can show. For this issue, the expected result is that the invoice actually sends.
On staging with a phone that has no Expensify account, SendInvoice returns 666 Invalid invoice receiver. The payload had:
So the client is sending a raw phone number without @expensify.sms. That fails the request; the optimistic invoice room still opens, and the skeleton sticks because loading state isn’t seeded / openReport never re-runs for that optimistic CHAT room.
I’d like to post a proposal covering:
Normalize phone receivers with addSMSDomainIfPhoneNumber
Seed RAM_ONLY_REPORT_LOADING_STATE for new invoice rooms
Re-run fetchReport when isOptimisticReport clears
Okay to post that here?
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.78-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-09-22. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
applause-bot commentedon Jul 28, 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/7358853808e0c95fc1e0cb337c6bca2e56a65551f58e76dd6973e65d82b32be0
MelvinBot commentedon Jul 28, 2026
Proposal
The analysis below is provided in case it's useful for #91557.
What is the root cause of that problem?
Sending an invoice to a recipient who has no existing invoice room creates a brand-new optimistic invoice room (
type: CHAT,chatType: INVOICE,reportMetadata.isOptimisticReport: true).ReportFetchHandlerdeliberately skips theopenReport()call for optimistic CHAT-type reports that aren't policy expense chats — which is exactly the shape of a new invoice room (ReportFetchHandler.tsx:157).openReport()is the only thing that writes the report loading state and clearsisLoadingInitialReportActions. Because it's skipped, that flag keeps its default oftrue, and the report-actions skeleton gate stays on forever.When
SendInvoicesucceeds and flipsisOptimisticReporttofalse,openReportis never retried, because the effect that triggersfetchReport()does not depend onisOptimisticReport(ReportFetchHandler.tsx:364-370). Only a page refresh remounts the screen — by then the room is no longer optimistic, soopenReportfinally runs and the skeleton resolves. That's the "until refresh" behavior.Existing recipients work because their invoice room already exists in Onyx (not optimistic), so
openReportruns normally on first load.What changes do you think we should make in order to solve the problem?
Make
ReportFetchHandlerre-runopenReportonce the optimistic invoice room reconciles into a real report. The minimal fix is to addreportMetadata.isOptimisticReportto thefetchReport()effect's dependency array atReportFetchHandler.tsx:370. The guard still correctly skipsopenReportwhile the room is optimistic (server doesn't know it yet), then re-fires onceSendInvoice's response flips the flag tofalse, clearing the skeleton without a refresh.What alternative solutions did you explore? (Optional)
Narrow the skip-guard at
ReportFetchHandler.tsx:157so invoice chat rooms (chatType === INVOICE) aren't treated like plain optimistic chats. This is riskier — an earlyopenReportfor a not-yet-persisted room could 404 — so the dependency-array fix is preferred.Investigation details & evidence
Not a regression from the QA-referenced PR (#96441). That PR only swapped
formatPhoneNumberfrom a module import to theuseLocalize()context. The two implementations are byte-equivalent (same OnyxCOUNTRY_CODEkey, same?? 1default, neither returnsundefined), both live callers pass a definedformatPhoneNumber, and the optimistic-report/navigation logic inSendInvoice.tswas untouched. The bug was found during that PR's QA regression pass, not caused by it — consistent with #91557 predating the PR (reported on v9.3.80-0).Why it's not phone-specific: the code distinguishes "existing invoice room" vs "new optimistic room", not phone vs email. A brand-new email recipient with no prior invoice room should reproduce the same skeleton. Phone-number-with-no-account is simply a dependable way to force a new room.
Supporting code path:
type: CHAT—ReportUtils.tsbuildOptimisticChatReportisOptimisticReport: trueset only for new rooms —SendInvoice.ts:239-260isLoadingInitialReportActionsdefaults totrue—ReportNotFoundGuard.tsx:45-55ReportActionsListContext.tsx:86Ruled out: reportID mismatch (navigated room ID matches the built optimistic room ID) and a
DEFAULT_NUMBER_IDfallback (a no-account phone contact still gets a real deterministic optimistic accountID viagenerateAccountID).Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/97203)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
melvin-bot commentedon Jul 28, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Krishna2323 (
External)melvin-bot commentedon Jul 28, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022082016965249808557
ashu75575 commentedon Jul 28, 2026
Hey @Krishna2323 — I dug into this and wanted to share findings before posting a full proposal.
MelvinBot flagged this as a likely duplicate of #91557. The skeleton symptom is similar, but I don’t think we should close this as a duplicate of the selected #91557 proposal. That fix seeds loading state on failure so the error can show. For this issue, the expected result is that the invoice actually sends.
On staging with a phone that has no Expensify account, SendInvoice returns 666 Invalid invoice receiver. The payload had:
receiverEmail: +918375810000
Auth expects:
+918375810000@expensify.sms
So the client is sending a raw phone number without @expensify.sms. That fails the request; the optimistic invoice room still opens, and the skeleton sticks because loading state isn’t seeded / openReport never re-runs for that optimistic CHAT room.
I’d like to post a proposal covering:
Normalize phone receivers with addSMSDomainIfPhoneNumber
Seed RAM_ONLY_REPORT_LOADING_STATE for new invoice rooms
Re-run fetchReport when isOptimisticReport clears
Okay to post that here?
melvin-bot commentedon Jul 31, 2026
@Krishna2323 Whoops! This issue is 2 days overdue. Let's get this updated quick!
Krishna2323 commentedon Aug 3, 2026
I'll review this tomorrow.
43 remaining items
melvin-bot commentedon Sep 15, 2026
@Krishna2323
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.78-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-09-22. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
melvin-bot commentedon Sep 21, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Sep 21, 2026
Payment Summary
Resolving PRs:
Upwork Job
BugZero Checklist (@mallenexpensify)
Krishna2323 commentedon Sep 22, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: Implement Send Invoice flow from Global Create #40015 (comment)
Link to the comment on the Issue: [$500] [HOLD for payment 2024-05-08] CRITICAL: [Send invoice] Implement Send Invoice flow from Global Create #40012 (comment)
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/685100
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-b9c8-a727-d012-dd1197875c64mallenexpensify commentedon Sep 24, 2026
Payment Summary
Contributor: @ashu75575 paid $250 via Upwork
Contributor+: @Krishna2323 due $250 via NewDot
@ashu75575 can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022103239518168553480
ashu75575 commentedon Sep 25, 2026
@mallenexpensify
Offer accepted. Thanks !!
mallenexpensify commentedon Sep 25, 2026
@ashu75575 paid, summary updated above. Thx.
laurenreidexpensify commentedon Oct 21, 2026
Approved @Krishna2323 $250 New Expensify