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-07] [$250] Not here page opens in background on selecting Pay with Business BA in offline mode #87349
Version Number: v9.3.54-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:#87135 Email or phone of affected tester (no customers):kiatest.80+ck47261@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11/Chrome App Component: Money Requests
Action Performed:
On tab 1 - Navigate to staging.new.expensify.com
Sign in to an account user A with USD currency without any policy and bank account
On incognito mode - From another account user B, request money to the account user A with USD currency in USD
Go back to user A account tab 1
Go offline
Press the Pay button > Pay with business bank account
Observe Not here page displayed in background
Expected Result:
Workspace should be created in background which to be displayed in grayed out status (in 50% opacity)
Actual Result:
Not here page opens in background on selecting Pay with Business BA in offline mode
When a user with no workspace clicks "Pay with business bank account" while offline, createWorkspaceFromIOUPayment (BaseKYCWall.tsx:172-183) creates the workspace optimistically via Onyx, then immediately navigates to ReimbursementAccountPage (line 193).
There is a race condition: Onyx's optimistic SET for the new policy is asynchronous, but navigation is synchronous. When ReimbursementAccountPage mounts:
The offline blocking view (line 433) is skipped because the optimistic reimbursement account data makes hasLoadedData true.
isLoadingPolicy (withPolicy.tsx:95) resolves to false because useOnyx for the brand-new policyID resolves with undefined before the optimistic data propagates.
The empty-policy guard (line 465) fires: isEmptyObject(policy) is true → FullPageNotFoundView renders "Hmm... it's not here".
Notably, the existing code for the has-admin-policy branch uses setNavigationActionToMicrotaskQueue (line 148) to defer navigation, but the no-policy branch (line 189-193) navigates directly — missing the same deferral.
What changes do you think we should make in order to solve the problem?
Wrap the navigation in the no-admin-policy branch (BaseKYCWall.tsx lines 188-193) with setNavigationActionToMicrotaskQueue, matching the pattern already used in the admin-policy branch at line 148. This defers navigation to the microtask queue, giving Onyx time to flush the optimistic policy data before ReimbursementAccountPage mounts and checks for it.
// Before (navigates immediately, races with Onyx):
if (workspaceChatReportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(...));
}
Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID}));
// After (defers navigation to microtask queue):
setNavigationActionToMicrotaskQueue(() => {
if (workspaceChatReportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(...));
}
Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID}));
});
What alternative solutions did you explore? (Optional)
Awaiting Onyx updates before navigating: Would require making the selectPaymentMethod callback async and awaiting createWorkspaceFromIOUPayment's Onyx operations. More invasive change with wider blast radius.
Adding an offline-specific guard in ReimbursementAccountPage: Could check isOffline && isEmptyObject(policy) and show the offline blocking view instead of "Not here". This treats the symptom rather than the root cause and could mask other issues.
Investigation details
Data flow:
SettlementButton shows "Pay with business bank account" when activeAdminPolicies.length === 0 (index.tsx:303)
Button press → handlePaymentSelection → triggerKYCFlow → continueAction in KYCWall
BaseKYCWall.selectPaymentMethod: BUSINESS_BANK_ACCOUNT branch, no admin policy → createWorkspaceFromIOUPayment (Policy.ts:3932)
Optimistic data queued in Onyx (async), navigation fires immediately
ReimbursementAccountPage renders before policy data is available → "Not here"
Additional note:KYCWall's isDisabled prop (types.ts:46) is declared but never destructured in BaseKYCWall — the button remains clickable offline even though SettlementButton passes isDisabled={isOffline}. This is a secondary issue but not the root cause of the "Not here" page.
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.
Please re-state the problem that we are trying to solve in this issue.
When a user goes offline and then taps "Pay with Business Bank Account" on an IOU report, a "Not here" (NotFoundPage) appears in the background instead of the workspace being created optimistically and shown in a grayed-out/pending state.
What is the root cause of that problem?
In BaseKYCWall.tsx, when the user selects CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT on an IOU report with no existing admin policy, createWorkspaceFromIOUPayment is called and returns workspaceChatReportID and policyID. The code then navigates to the new workspace chat report (inside the if (workspaceChatReportID) guard), but immediately after — unconditionally and outside that guard — it also navigates to ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID}). When offline, that bank account setup route has no backing data in Onyx (the API call is queued but never executes), so the router resolves the route to the "Not here" page. Because the second Navigation.navigate call fires synchronously after the first, the "Not here" page ends up on top.
What changes do you think we should make in order to solve the problem?
We should skip the navigation to BANK_ACCOUNT_WITH_STEP_TO_OPEN when the user is offline, since the workspace and bank account data have not been persisted to the server yet and any route that depends on real server data will resolve to "Not here". The workspace chat navigation alone is sufficient when offline — the user will see the optimistically created workspace in a pending state, which matches the expected result. The bank account setup navigation can fire once the user is back online.
To do this we need to bring isOffline from useNetwork into BaseKYCWall and guard the bank account setup navigation:
+import useNetwork from '@hooks/useNetwork';
...
function KYCWall({ ... }) {
+ const {isOffline} = useNetwork();
...
// inside selectPaymentMethod, after createWorkspaceFromIOUPayment:
if (workspaceChatReportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(workspaceChatReportID, reportPreviewReportActionID));
}
- // Navigate to the bank account set up flow for this specific policy- Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID}));+ // Navigate to the bank account set up flow only when online,+ // since the route requires server-persisted data.+ if (!isOffline) {+ Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID}));+ }
changed the title [-]Not here page opens in background on selecting Pay with Business BA in offline mode[/-][+][$250] Not here page opens in background on selecting Pay with Business BA in offline mode[/+]on Apr 8, 2026
Please re-state the problem that we are trying to solve in this issue.
When a user with no workspace selects Pay with business bank account while offline, the flow should stay on optimistic/pending workspace state, but a “Not here” page appears in the background.
What is the root cause of that problem?
In BaseKYCWall, the existing-admin-policy path defers navigation with setNavigationActionToMicrotaskQueue, but the no-admin-policy path (where createWorkspaceFromIOUPayment is called) performs immediate navigation and then immediately pushes the bank-account route.
That immediate route transition can mount ReimbursementAccountPage before policy data is available for the new policy, and this screen can resolve to its not-found guard once loading settles with an empty/non-admin policy.
I could download but could not decode the attached video in this unattended environment, so I am not claiming frame-level visual verification.
What changes do you think we should make in order to solve the problem?
In the no-admin-policy branch, wrap post-creation navigation in setNavigationActionToMicrotaskQueue (same pattern used in the admin-policy branch) so optimistic policy/report updates settle before route evaluation.
Keep the workspace chat navigation first, then bank-account setup navigation, but execute both inside that deferred callback.
As a safety guard, skip or defer bank-account setup navigation while offline when required data is not ready yet, to avoid surfacing NotFound during optimistic creation.
What alternative solutions did you explore? (Optional)
A narrower alternative is to only gate bank-account navigation by offline status. That helps this exact scenario, but it does not address the broader timing inconsistency between the two BBA code paths. Aligning both paths to deferred navigation is more robust.
I'll work on this issue. The problem occurs when offline mode triggers the "Not here" page instead of creating a workspace when selecting "Pay with business bank account."
My approach:
Check the offline handling logic in the payment flow to ensure workspace creation is attempted before showing the offline error page
Verify the conditional rendering logic for the workspace creation modal vs. offline state
Ensure proper state management when network connectivity is lost during the payment process
I can have a fix ready for review within 2-3 days.
Activity
MelvinBot commentedon Apr 8, 2026
Proposal
What is the root cause of that problem?
When a user with no workspace clicks "Pay with business bank account" while offline,
createWorkspaceFromIOUPayment(BaseKYCWall.tsx:172-183) creates the workspace optimistically via Onyx, then immediately navigates toReimbursementAccountPage(line 193).There is a race condition: Onyx's optimistic
SETfor the new policy is asynchronous, but navigation is synchronous. WhenReimbursementAccountPagemounts:hasLoadedDatatrue.isLoadingPolicy(withPolicy.tsx:95) resolves tofalsebecauseuseOnyxfor the brand-new policyID resolves withundefinedbefore the optimistic data propagates.isEmptyObject(policy)istrue→FullPageNotFoundViewrenders "Hmm... it's not here".Notably, the existing code for the has-admin-policy branch uses
setNavigationActionToMicrotaskQueue(line 148) to defer navigation, but the no-policy branch (line 189-193) navigates directly — missing the same deferral.What changes do you think we should make in order to solve the problem?
Wrap the navigation in the no-admin-policy branch (
BaseKYCWall.tsxlines 188-193) withsetNavigationActionToMicrotaskQueue, matching the pattern already used in the admin-policy branch at line 148. This defers navigation to the microtask queue, giving Onyx time to flush the optimistic policy data beforeReimbursementAccountPagemounts and checks for it.What alternative solutions did you explore? (Optional)
selectPaymentMethodcallback async and awaitingcreateWorkspaceFromIOUPayment's Onyx operations. More invasive change with wider blast radius.ReimbursementAccountPage: Could checkisOffline && isEmptyObject(policy)and show the offline blocking view instead of "Not here". This treats the symptom rather than the root cause and could mask other issues.Investigation details
Data flow:
SettlementButtonshows "Pay with business bank account" whenactiveAdminPolicies.length === 0(index.tsx:303)handlePaymentSelection→triggerKYCFlow→continueActionin KYCWallBaseKYCWall.selectPaymentMethod:BUSINESS_BANK_ACCOUNTbranch, no admin policy →createWorkspaceFromIOUPayment(Policy.ts:3932)ReimbursementAccountPagerenders before policy data is available → "Not here"Additional note:
KYCWall'sisDisabledprop (types.ts:46) is declared but never destructured inBaseKYCWall— the button remains clickable offline even thoughSettlementButtonpassesisDisabled={isOffline}. This is a secondary issue but not the root cause of the "Not here" page.Next 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.MobileMage commentedon Apr 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user goes offline and then taps "Pay with Business Bank Account" on an IOU report, a "Not here" (NotFoundPage) appears in the background instead of the workspace being created optimistically and shown in a grayed-out/pending state.
What is the root cause of that problem?
In
BaseKYCWall.tsx, when the user selectsCONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNTon an IOU report with no existing admin policy,createWorkspaceFromIOUPaymentis called and returnsworkspaceChatReportIDandpolicyID. The code then navigates to the new workspace chat report (inside theif (workspaceChatReportID)guard), but immediately after — unconditionally and outside that guard — it also navigates toROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID}). When offline, that bank account setup route has no backing data in Onyx (the API call is queued but never executes), so the router resolves the route to the "Not here" page. Because the secondNavigation.navigatecall fires synchronously after the first, the "Not here" page ends up on top.App/src/components/KYCWall/BaseKYCWall.tsx
Lines 184 to 194 in 05327cf
What changes do you think we should make in order to solve the problem?
We should skip the navigation to
BANK_ACCOUNT_WITH_STEP_TO_OPENwhen the user is offline, since the workspace and bank account data have not been persisted to the server yet and any route that depends on real server data will resolve to "Not here". The workspace chat navigation alone is sufficient when offline — the user will see the optimistically created workspace in a pending state, which matches the expected result. The bank account setup navigation can fire once the user is back online.To do this we need to bring
isOfflinefromuseNetworkintoBaseKYCWalland guard the bank account setup navigation:App/src/components/KYCWall/BaseKYCWall.tsx
Lines 192 to 194 in 05327cf
What alternative solutions did you explore? (Optional)
N/A
melvin-bot commentedon Apr 8, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (
External)[-]Not here page opens in background on selecting Pay with Business BA in offline mode[/-][+][$250] Not here page opens in background on selecting Pay with Business BA in offline mode[/+]melvin-bot commentedon Apr 8, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022041808716441071221
KJ21-ENG commentedon Apr 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user with no workspace selects Pay with business bank account while offline, the flow should stay on optimistic/pending workspace state, but a “Not here” page appears in the background.
What is the root cause of that problem?
In
BaseKYCWall, the existing-admin-policy path defers navigation withsetNavigationActionToMicrotaskQueue, but the no-admin-policy path (wherecreateWorkspaceFromIOUPaymentis called) performs immediate navigation and then immediately pushes the bank-account route.App/src/components/KYCWall/BaseKYCWall.tsx
Lines 141 to 147 in 1d43910
App/src/components/KYCWall/BaseKYCWall.tsx
Lines 165 to 177 in 1d43910
That immediate route transition can mount
ReimbursementAccountPagebefore policy data is available for the new policy, and this screen can resolve to its not-found guard once loading settles with an empty/non-admin policy.App/src/pages/workspace/withPolicy.tsx
Lines 91 to 96 in 1d43910
App/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx
Lines 488 to 506 in 1d43910
I could download but could not decode the attached video in this unattended environment, so I am not claiming frame-level visual verification.
What changes do you think we should make in order to solve the problem?
setNavigationActionToMicrotaskQueue(same pattern used in the admin-policy branch) so optimistic policy/report updates settle before route evaluation.What alternative solutions did you explore? (Optional)
A narrower alternative is to only gate bank-account navigation by offline status. That helps this exact scenario, but it does not address the broader timing inconsistency between the two BBA code paths. Aligning both paths to deferred navigation is more robust.
snakefood3232 commentedon Apr 8, 2026
I'll work on this offline mode issue where the "Not here" page incorrectly appears instead of a grayed-out workspace.
Approach:
Timeline: I can have a PR ready within 2-3 days after investigating the specific code paths involved in this payment flow.
snakefood3232 commentedon Apr 8, 2026
I'll work on this issue. The problem occurs when offline mode triggers the "Not here" page instead of creating a workspace when selecting "Pay with business bank account."
My approach:
I can have a fix ready for review within 2-3 days.
snakefood3232 commentedon Apr 8, 2026
I'll work on this issue where the "Not here" page appears in offline mode instead of the expected workspace creation.
Approach:
Timeframe: I can have a PR ready within 2-3 days after investigation.
I'm familiar with the codebase and can implement a fix that maintains both online and offline functionality.
37 remaining items
melvin-bot commentedon May 6, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon May 7, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon May 8, 2026
Payment Summary
Contributor: @nabi-ebrahimi paid $250 via Upwork
Contributor+: @brunovjk due $250 via NewDot
@nabi-ebrahimi can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022041808716441071221
@nabi-ebrahimi can you plz enter your Upwork deets again, per the format below, hoping we fixed a bug that'll store yours.
nabi-ebrahimi commentedon May 8, 2026
Contributor details
Your Expensify account email: nabi.zarin.work@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0153e611bb8e745154
melvin-bot commentedon May 8, 2026
Details
nabi-ebrahimi commentedon May 8, 2026
@mallenexpensify, the offer accepted. thanks.
brunovjk commentedon May 8, 2026
Requested in ND. Thank you.
laurenreidexpensify commentedon May 8, 2026
$250 approved for @brunovjk
melvin-bot commentedon May 11, 2026
@mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
nabi-ebrahimi commentedon May 12, 2026
@mallenexpensify, could you please take a look at this when you get a chance. thanks.
mallenexpensify commentedon May 12, 2026
@nabi-ebrahimi paid, summary updated above. Thx for the ping.