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-02-25] Company Cards - Error is not shown when navigated to Company Cards page #81115
Version Number: 9.3.11-17 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#80734 Email or phone of affected tester (no customers):applausetester+omqq1@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Web (Mac/Chrome) App Component: Workspace Settings
🚨 Edited by proposal-police: This proposal was edited at 2026-01-31 19:38:10 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When navigating to the Company Cards page of a newly created workspace while "Simulate failing network requests" is enabled and Onyx data has been cleared, the expected error UI (introduced in PR #80734) does not appear. Instead, the standard landing/empty state page is shown, even though the backend request to load company card feeds has failed.
What is the root cause of that problem?
When a workspace is created optimistically with failing network requests, the policy object never receives a workspaceAccountID from the server because the CreateWorkspace API call fails. The optimistic policy data does not include workspaceAccountID, so it remains undefined.
As a result, on the Company Cards page, workspaceAccountID falls back to CONST.DEFAULT_NUMBER_ID (which is 0), and domainOrWorkspaceAccountID also resolves to 0.
The openPolicyCompanyCardsPage function is then called with domainOrWorkspaceAccountID = 0, and both its optimistic and failure data are written to the Onyx collection key sharedNVP_private_domain_member_0.
However, Onyx is configured with skippableCollectionMemberIDs that includes the string '0' (derived from DEFAULT_NUMBER_ID). This causes Onyx to silently discard any writes to collection keys whose member ID suffix is '0'.
Because the failure data (containing the error) is silently dropped by Onyx, the workspaceCardFeedsErrors in the Table component remains undefined, feedErrorKey is never set, and the error UI at line 377 never renders. Instead, the isNoFeed condition at line 356 is true (since no feed data was loaded) and the empty state is shown.
What changes do you think we should make in order to solve the problem?
The fix requires two small changes, both focused on handling the case where domainOrWorkspaceAccountID equals CONST.DEFAULT_NUMBER_ID.
In src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/index.tsx, the workspaceCardFeedsErrors computation (around line 98) should detect when domainOrWorkspaceAccountID === CONST.DEFAULT_NUMBER_ID and the user is not offline, and treat this as a workspace feeds load error directly rather than relying on Onyx-stored error data. The logic would check domainOrWorkspaceAccountID === CONST.DEFAULT_NUMBER_ID && !isOffline and, when true, synthesize the same error object that the openPolicyCompanyCardsPage failure handler would have written: { [CONST.COMPANY_CARDS.WORKSPACE_FEEDS_LOAD_ERROR]: translate('workspace.companyCards.error.workspaceFeedsCouldNotBeLoadedMessage') }. This feeds into the existing feedErrorKey / feedErrorMessage / feedErrorTitle logic and the error BlockingView at line 377 renders correctly, reusing all the existing error UI code without any new components or props.
In src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx, the loadPolicyCompanyCardsPage callback (line 47) should include an early return when domainOrWorkspaceAccountID === CONST.DEFAULT_NUMBER_ID to avoid making a useless API call whose result would be silently discarded by Onyx anyway. This also ensures that when the user taps "Try Again" on the error UI, the retry only fires once the workspace has been properly created and has a valid workspaceAccountID. When the network recovers and the workspace creation succeeds, workspaceAccountID becomes a valid non-zero number, the domainOrWorkspaceAccountID value changes, the useEffect dependency triggers a re-run, and the openPolicyCompanyCardsPage call proceeds with a valid key.
One thing to double-check: when the workspace is created optimistically and the network is failing, workspaceAccountID can be undefined and fall back to DEFAULT_NUMBER_ID (0). Since Onyx skips collection member ID "0", any failure data written there will be dropped silently.
Two possible mitigations to consider:
Guard the read: early-return from openPolicyCompanyCardsPage when domainOrWorkspaceAccountID === DEFAULT_NUMBER_ID, so we don’t issue a no-op request.
UI fallback: when online and domainOrWorkspaceAccountID === DEFAULT_NUMBER_ID after policy load, synthesize a WORKSPACE_FEEDS_LOAD_ERROR locally so the existing error UI can render.
Both approaches keep the fix localized without changing global Onyx behavior.
📣 @khaoticvs! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.21-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@Ollyws@brianlee-expensify 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]
[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:
[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.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
1. Create a new workspace with 'simulate failing network requests' enabled in dev settings
2. Navigate to Company Cards page for that workspace
3. Verify the error BlockingView is displayed
Activity
melvin-bot commentedon Jan 31, 2026
Triggered auto assignment to @brianlee-expensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.melvin-bot commentedon Jan 31, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (
External)MobileMage commentedon Jan 31, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-01-31 19:38:10 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When navigating to the Company Cards page of a newly created workspace while "Simulate failing network requests" is enabled and Onyx data has been cleared, the expected error UI (introduced in PR #80734) does not appear. Instead, the standard landing/empty state page is shown, even though the backend request to load company card feeds has failed.
What is the root cause of that problem?
When a workspace is created optimistically with failing network requests, the policy object never receives a
workspaceAccountIDfrom the server because theCreateWorkspaceAPI call fails. The optimistic policy data does not includeworkspaceAccountID, so it remainsundefined.App/src/libs/actions/Policy/Policy.ts
Lines 2247 to 2324 in 76a45ec
As a result, on the Company Cards page,
workspaceAccountIDfalls back toCONST.DEFAULT_NUMBER_ID(which is0), anddomainOrWorkspaceAccountIDalso resolves to0.App/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx
Lines 32 to 45 in 76a45ec
The
openPolicyCompanyCardsPagefunction is then called withdomainOrWorkspaceAccountID = 0, and both its optimistic and failure data are written to the Onyx collection keysharedNVP_private_domain_member_0.App/src/libs/actions/CompanyCards.ts
Lines 842 to 881 in 76a45ec
However, Onyx is configured with
skippableCollectionMemberIDsthat includes the string'0'(derived fromDEFAULT_NUMBER_ID). This causes Onyx to silently discard any writes to collection keys whose member ID suffix is'0'.App/src/CONST/index.ts
Line 7944 in 76a45ec
App/src/setup/index.ts
Line 61 in 76a45ec
Because the failure data (containing the error) is silently dropped by Onyx, the
workspaceCardFeedsErrorsin the Table component remainsundefined,feedErrorKeyis never set, and the error UI at line 377 never renders. Instead, theisNoFeedcondition at line 356 is true (since no feed data was loaded) and the empty state is shown.App/src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/index.tsx
Lines 97 to 104 in 76a45ec
App/src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/index.tsx
Lines 356 to 377 in 76a45ec
What changes do you think we should make in order to solve the problem?
The fix requires two small changes, both focused on handling the case where
domainOrWorkspaceAccountIDequalsCONST.DEFAULT_NUMBER_ID.In
src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/index.tsx, theworkspaceCardFeedsErrorscomputation (around line 98) should detect whendomainOrWorkspaceAccountID === CONST.DEFAULT_NUMBER_IDand the user is not offline, and treat this as a workspace feeds load error directly rather than relying on Onyx-stored error data. The logic would checkdomainOrWorkspaceAccountID === CONST.DEFAULT_NUMBER_ID && !isOfflineand, when true, synthesize the same error object that theopenPolicyCompanyCardsPagefailure handler would have written:{ [CONST.COMPANY_CARDS.WORKSPACE_FEEDS_LOAD_ERROR]: translate('workspace.companyCards.error.workspaceFeedsCouldNotBeLoadedMessage') }. This feeds into the existingfeedErrorKey/feedErrorMessage/feedErrorTitlelogic and the error BlockingView at line 377 renders correctly, reusing all the existing error UI code without any new components or props.App/src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/index.tsx
Lines 97 to 114 in 76a45ec
In
src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx, theloadPolicyCompanyCardsPagecallback (line 47) should include an early return whendomainOrWorkspaceAccountID === CONST.DEFAULT_NUMBER_IDto avoid making a useless API call whose result would be silently discarded by Onyx anyway. This also ensures that when the user taps "Try Again" on the error UI, the retry only fires once the workspace has been properly created and has a validworkspaceAccountID. When the network recovers and the workspace creation succeeds,workspaceAccountIDbecomes a valid non-zero number, thedomainOrWorkspaceAccountIDvalue changes, theuseEffectdependency triggers a re-run, and theopenPolicyCompanyCardsPagecall proceeds with a valid key.App/src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx
Lines 47 to 63 in 76a45ec
What alternative solutions did you explore? (Optional)
N/A
khaoticvs commentedon Jan 31, 2026
One thing to double-check: when the workspace is created optimistically and the network is failing, workspaceAccountID can be undefined and fall back to DEFAULT_NUMBER_ID (0). Since Onyx skips collection member ID "0", any failure data written there will be dropped silently.
Two possible mitigations to consider:
Both approaches keep the fix localized without changing global Onyx behavior.
melvin-bot commentedon Jan 31, 2026
📣 @khaoticvs! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
melvin-bot commentedon Feb 4, 2026
@Ollyws Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
brianlee-expensify commentedon Feb 5, 2026
@Ollyws any updates here?
24 remaining items
melvin-bot commentedon Feb 18, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Feb 18, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.21-4 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-02-25. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Feb 18, 2026
@Ollyws @brianlee-expensify 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]
brianlee-expensify commentedon Feb 19, 2026
@MobileMage can you share your upwork profile so i can assign you this job?
brianlee-expensify commentedon Feb 19, 2026
@Ollyws can you fill out the bugzero checklist and confirm whether a regression test is needed? thanks in advance!
MobileMage commentedon Feb 19, 2026
@brianlee-expensify it's https://www.upwork.com/freelancers/~018bc4a19179469daa?mp_source=share
brianlee-expensify commentedon Feb 25, 2026
@Ollyws can you fill out the bugzero checklist and confirm whether a regression test is needed? thanks in advance!
brianlee-expensify commentedon Feb 26, 2026
bump for @Ollyws
Ollyws commentedon Feb 26, 2026
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/80734/changes#r2859152923
[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:
[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/604785
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
brianlee-expensify commentedon Feb 26, 2026
Payment Summary
Ollyws commentedon Feb 27, 2026
Requested in ND.
trjExpensify commentedon Mar 2, 2026
approved $250 for @Ollyws.