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-05-20] Expense - Report loads infinitely after paying offline #90030
Version Number: 9.3.69-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#89615 Email or phone of affected tester (no customers):sjdosjdosjdojnsodj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Create an expense.
Open the report.
Click Submit and Approve.
Go offline.
Click Mark as paid.
Expected Result:
Report will not load infinitely after paying offline.
👋 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:
Identify the pull request that introduced this issue and revert it.
Problem: PR #89615 moved the offline→online flush() subscriber and the addBecameActiveListener from module-level side effects into an initReconnect() function that is called from a React useEffect in Expensify.tsx. This creates a timing gap where the network can transition from offline→online before the subscriber is registered, so flush() is never called and the persisted PayMoneyRequest command never reaches the server — leaving the report stuck with pendingAction: ADD and an infinite loading skeleton.
Root Cause: The offline→online network state subscriber that calls flush() is no longer registered at module load time. It now requires initReconnect() to be called first, which only happens inside a useEffect in Expensify.tsx (runs asynchronously after render). Meanwhile, NetworkState.ts subscribes to NetInfo at module load time (configureAndSubscribe()), so it can detect and broadcast network transitions before the flush subscriber exists to receive them. The one-time startup flush in Network/index.ts also doesn't help if the device is offline at that point — flush() returns early.
Solution: Revert the offline→online flush subscriber and addBecameActiveListener back to module-level side effects (executed on import), as they were before PR #89615. These listeners must be registered before any network transition can occur. The initReconnect() wrapper and the useEffect call site in Expensify.tsx should be removed.
Specifically:
In Reconnect.ts: Move the subscribeNetworkState(...) and AppStateMonitor.addBecameActiveListener(...) calls back to module scope (outside any function). Reinitialize wasOffline to getIsOffline() at declaration time.
In Expensify.tsx: Remove the useEffect that calls initReconnect() and the didInitReconnectRef.
Investigation details
Timeline of the regression:
The original Reconnect.ts had the flush subscriber at module scope:
PR #89615 wrapped these in initReconnect() and deferred execution to a useEffect:
letwasOffline: boolean;// uninitialized until initReconnect()constinitReconnect=()=>{wasOffline=getIsOffline();subscribeNetworkState(()=>{ ... });AppStateMonitor.addBecameActiveListener(()=>{ ... });};
Why this causes the infinite loading:
User goes offline and taps "Mark as paid" → PayMoneyRequest is queued in PersistedRequests, optimistic Onyx updates applied (pendingAction: ADD on report action, pendingFields on report)
NetworkState detects offline→online transition via NetInfo (registered at module load, line 351)
NetworkState calls notifyListeners() → but the Reconnect.ts subscriber hasn't been registered yet (useEffect hasn't fired)
flush() is never called → PayMoneyRequest stays in the persisted queue → server never processes it → successData (which clears pendingAction and pendingFields) never runs
The report remains stuck with pending states, showing an infinite loading skeleton
Alternative explanations considered:
shouldWaitForTransactions skeleton: Could contribute if RAM_ONLY_REPORT_LOADING_STATE resets, but the primary cause is the flush never happening
onReachabilityConfirmed (line 58): This calls reconnect() (which syncs app data) but does NOT call flush(), so it doesn't help flush the persisted payment command
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
changed the title [-]Expense - Report loads infinitely after paying offline[/-][+][Due for payment 2026-05-20] Expense - Report loads infinitely after paying offline[/+]on May 13, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.72-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@arosiclair The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]
Activity
melvin-bot commentedon May 8, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #89615
melvin-bot commentedon May 8, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 8, 2026
👋 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:
MelvinBot commentedon May 8, 2026
Proposal
Problem: PR #89615 moved the offline→online
flush()subscriber and theaddBecameActiveListenerfrom module-level side effects into aninitReconnect()function that is called from a ReactuseEffectinExpensify.tsx. This creates a timing gap where the network can transition from offline→online before the subscriber is registered, soflush()is never called and the persistedPayMoneyRequestcommand never reaches the server — leaving the report stuck withpendingAction: ADDand an infinite loading skeleton.Root Cause: The offline→online network state subscriber that calls
flush()is no longer registered at module load time. It now requiresinitReconnect()to be called first, which only happens inside auseEffectin Expensify.tsx (runs asynchronously after render). Meanwhile,NetworkState.tssubscribes to NetInfo at module load time (configureAndSubscribe()), so it can detect and broadcast network transitions before the flush subscriber exists to receive them. The one-time startup flush inNetwork/index.tsalso doesn't help if the device is offline at that point —flush()returns early.Solution: Revert the offline→online flush subscriber and
addBecameActiveListenerback to module-level side effects (executed on import), as they were before PR #89615. These listeners must be registered before any network transition can occur. TheinitReconnect()wrapper and theuseEffectcall site inExpensify.tsxshould be removed.Specifically:
Reconnect.ts: Move thesubscribeNetworkState(...)andAppStateMonitor.addBecameActiveListener(...)calls back to module scope (outside any function). ReinitializewasOfflinetogetIsOffline()at declaration time.Expensify.tsx: Remove theuseEffectthat callsinitReconnect()and thedidInitReconnectRef.Investigation details
Timeline of the regression:
The original
Reconnect.tshad the flush subscriber at module scope:PR #89615 wrapped these in
initReconnect()and deferred execution to auseEffect:Why this causes the infinite loading:
PayMoneyRequestis queued inPersistedRequests, optimistic Onyx updates applied (pendingAction: ADDon report action,pendingFieldson report)notifyListeners()→ but theReconnect.tssubscriber hasn't been registered yet (useEffect hasn't fired)flush()is never called →PayMoneyRequeststays in the persisted queue → server never processes it →successData(which clearspendingActionandpendingFields) never runsAlternative explanations considered:
shouldWaitForTransactionsskeleton: Could contribute ifRAM_ONLY_REPORT_LOADING_STATEresets, but the primary cause is the flush never happeningonReachabilityConfirmed(line 58): This callsreconnect()(which syncs app data) but does NOT callflush(), so it doesn't help flush the persisted payment commandNext Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.arosiclair commentedon May 8, 2026
I'm having trouble reproducing right now because the inbox tab keeps crashing on staging
arosiclair commentedon May 8, 2026
No repro in prod v9.3.68-3. Okay I reproduced in staging v9.3.69-0
6 remaining items
arosiclair commentedon May 8, 2026
This revert also fixes some crashes in the inbox tab. Requested a CP here
melvin-bot commentedon May 8, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
melvin-bot commentedon May 8, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
arosiclair commentedon May 8, 2026
Fixed in v9.3.69-1
melvin-bot commentedon May 12, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
[-]Expense - Report loads infinitely after paying offline[/-][+][Due for payment 2026-05-20] Expense - Report loads infinitely after paying offline[/+]melvin-bot commentedon May 13, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon May 13, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.72-1 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-05-20. 🎊
melvin-bot commentedon May 13, 2026
@arosiclair The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]