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-11-05] [$175] Workspaces - Unable to remove the RBR on archived Workspace #103492
Version Number: v9.5.5-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:#98029 Email or phone of affected tester (no customers):applausetester+vq+0810@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Windows 10/Chrome App Component: Workspace Settings
Action Performed:
Precondition: User the Expensifail account as an admin of a Workspace
Open the New Dot app
Navigate to the Workspace - Accounting
Connect to Sage Intacct - Enter incorrect credentials (to get an RBR )
Go to Workspace - Three dots - Archived Workspace - Confirm
Expected Result:
RBR remove after the Workspace is archived
Actual Result:
RBR remains on the Workspace tab but can't remove it
Please re-state the problem that we are trying to solve in this issue.
After you archive a workspace that has an accounting sync error, the Workspaces tab keeps its red dot (RBR). The archived workspace is hidden from the list and you can't edit its settings, so you can't clear the error.
What is the root cause of that problem?
Archiving keeps the workspace in Onyx. It only adds archivedDate. The Sage Intacct sync error stays on the policy (Policy.ts:744-786).
The workspaces list hides archived policies through shouldShowPolicy, and canEditWorkspaceSettings blocks edits on them. That leaves the user no way to fix the error.
What changes do you think we should make in order to solve the problem?
In usePoliciesWithCardFeedErrors, leave archived policies out of cleanPolicies with the existing isArchivedPolicy helper. Use isArchivedOrPendingDeletePolicy instead if you also want to hide errors while a delete is pending. Every Workspaces tab check reads cleanPolicies, so this one change fixes all of them.
Optional, for consistency: in createPolicyErrorsSelector (WorkspaceRowBrickRoadIndicator.tsx:37-40), return false for archived policies. Otherwise the row still shows an RBR you can't fix when the "Archived" filter is on.
Add a unit test: a policy with archivedDate and a failed Intacct sync should give no Workspaces tab indicator.
Filter on the client, not by clearing the error on the backend. That way the error comes back if the workspace is unarchived.
What alternative solutions did you explore? (Optional)
Have ArchivePolicy clear connections.*.lastSync errors. I rejected this because unarchiving would hide a real, unresolved sync error.
Investigation details
Chain for the tab color: WorkspacesTabButton → useWorkspacesTabIndicatorStatus → usePolicyIndicatorChecks → usePoliciesWithCardFeedErrors().cleanPolicies.
Side effect: useAccountIndicatorChecks reads isPolicyAdmin from the same hook. After the change, card feed errors on an archived workspace will no longer hide the employee card feed RBR on the Account tab. That is probably correct. useCardFeedErrors may still count feeds from archived workspaces, so check it during the PR.
The workspace switcher (useWorkspaceList) already skips archived policies through shouldShowPolicy.
I found this by reading the code. I did not test it in the app.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/103492) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Workspaces - Unable to remove the RBR on archived Workspace[/-][+][$175] Workspaces - Unable to remove the RBR on archived Workspace[/+]on Oct 8, 2026
Please re-state the problem that we are trying to solve in this issue.
The Red Brick Road (RBR) error indicator remains permanently visible on the Workspaces tab (and on the workspace row in the workspaces list) after a workspace with an accounting sync error (such as bad credentials) is archived, and the user has no way to dismiss or clear it because archived workspaces are read-only.
What is the root cause of that problem?
In src/hooks/usePoliciesWithCardFeedErrors.ts, cleanPolicies filters policies solely by whether they possess an id:
It does not filter out archived policies using isArchivedPolicy(policy).
When usePolicyIndicatorChecks iterates through cleanPolicies to evaluate shouldShowSyncError (along with shouldShowPolicyError, shouldShowCustomUnitsError, shouldShowEmployeeListError, etc.), the archived workspace is still evaluated:
Because neither shouldShowSyncError nor cleanPolicies checks if the policy is archived, the hook returns HAS_SYNC_ERRORS, keeping the red dot visible in useWorkspacesTabIndicatorStatus.
Similarly, in src/libs/PolicyUtils/index.ts, getPolicyBrickRoadIndicatorStatus lacks an early return check for isArchivedPolicy(policy), which causes WorkspaceRowBrickRoadIndicator.tsx to continue displaying the red indicator on the row even when the workspace is archived.
What changes do you think we should make in order to solve the problem?
In src/hooks/usePoliciesWithCardFeedErrors.ts:
Exclude archived policies when generating cleanPolicies so usePolicyIndicatorChecks suppresses error indicators originating from read-only archived workspaces:
Modifying each individual shouldShow*Error function to check !isArchivedPolicy(policy): this adds redundant checks across multiple utility functions instead of handling it centrally in cleanPolicies, getPolicyBrickRoadIndicatorStatus, and row selector.
Clearing error fields in Onyx when archiving a policy: this would be destructive and fragile if server responses or sync progress updates re-populate the error keys asynchronously.
Please re-state the problem that we are trying to solve in this issue.
When a workspace with an accounting sync error (such as invalid Sage Intacct credentials) is archived, the Red Brick Road (RBR) dot remains permanently visible on the Workspaces bottom tab. The user cannot dismiss or resolve the error because archived workspaces are read-only and hidden from standard active settings.
What is the root cause of that problem?
The global Workspaces tab indicator in usePolicyIndicatorChecks.ts evaluates all policy errors across cleanPolicies.
cleanPolicies is provided by usePoliciesWithCardFeedErrors.ts:
It filters out only null policies that lack an id. It does not filter out archived policies (isArchivedPolicy(policy)).
When a policy is archived, it remains in Onyx under ONYXKEYS.COLLECTION.POLICY with its errors intact and isArchived: true / archivedDate set.
Because cleanPolicies continues to include archived policies, policyErrorChecks in usePolicyIndicatorChecks.ts flags CONST.INDICATOR_STATUS.HAS_SYNC_ERRORS via shouldShowSyncError for the archived workspace, keeping the global Workspaces tab RBR permanently lit.
In addition, createPolicyErrorsSelector in WorkspaceRowBrickRoadIndicator.tsx does not check isArchivedPolicy(policy), which leaves the row indicator active on archived workspace rows.
What changes do you think we should make in order to solve the problem?
In src/hooks/usePoliciesWithCardFeedErrors.ts, import isArchivedPolicy from @libs/PolicyUtils and exclude archived policies from cleanPolicies:
This ensures that all global indicator checks in usePolicyIndicatorChecks.ts (sync errors, card feed errors, QBO export errors, employee list errors, custom units errors, etc.) ignore archived policies.
In src/components/Tables/WorkspaceListTable/WorkspaceRowBrickRoadIndicator.tsx, guard createPolicyErrorsSelector against archived policies:
@MelvinBot Could you double-check root cause in your proposal? I'm unable to reproduce this on the latest main branch. Do we specifically need to use an expensifail account to trigger this bug?
@cretadn22 Yes, exactly! To reproduce the bug, the workspace must have an existing policy/accounting sync error in Onyx before it is archived:
An @expensifail.com admin account is needed because it has access to the Sage Intacct accounting integration.
Go to Workspace > Accounting > Sage Intacct and enter invalid credentials so the backend returns an error, setting the RBR error badge on the accounting connection.
Then go to Workspace > Three dots > Archive Workspace > Confirm.
Once archived, the child configuration tabs (like Accounting) are locked/hidden, preventing the user from dismissing or resolving the connection error. However, the workspace navigation row still evaluates hasPolicyError on the archived policy in Onyx, leaving the RBR badge permanently visible with no way to remove it.
Without that initial failed connection (via the @expensifail.com test account) generating the error state prior to archiving, the workspace remains clean and won't surface an RBR.
changed the title [-][$175] Workspaces - Unable to remove the RBR on archived Workspace[/-][+][Due for payment 2026-11-05] [$175] Workspaces - Unable to remove the RBR on archived Workspace[/+]on Oct 29, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.25-2 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-11-05. 🎊
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.
Link to issue:
Regression Test Proposal
Test:
Precondition: Enable the archivePolicies beta flag.
Open the New Dot app
Navigate to Workspace > Accounting
Connect to Sage Intacct using incorrect credentials (to trigger an RBR)
Go to Workspace > Three dots > Archived Workspace > Confirm
Verify that the RBR on the workspace is removed after it is archived
Filter by archived workspaces
Verify that the RBR on the workspace row is also removed
Activity
MelvinBot commentedon Oct 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After you archive a workspace that has an accounting sync error, the Workspaces tab keeps its red dot (RBR). The archived workspace is hidden from the list and you can't edit its settings, so you can't clear the error.
What is the root cause of that problem?
Archiving keeps the workspace in Onyx. It only adds
archivedDate. The Sage Intacct sync error stays on the policy (Policy.ts:744-786).The Workspaces tab RBR checks every policy that has an
id. It never skips archived policies (usePoliciesWithCardFeedErrors.ts:15). So theHAS_SYNC_ERRORScheck inusePolicyIndicatorChecks.ts:56-65still finds the archived workspace and turns the tab red.The workspaces list hides archived policies through
shouldShowPolicy, andcanEditWorkspaceSettingsblocks edits on them. That leaves the user no way to fix the error.This started with feat: Replace Delete with Archive behind the archivePolicies beta. Delete didn't have this problem because the server removes a deleted policy from Onyx.
What changes do you think we should make in order to solve the problem?
usePoliciesWithCardFeedErrors, leave archived policies out ofcleanPolicieswith the existingisArchivedPolicyhelper. UseisArchivedOrPendingDeletePolicyinstead if you also want to hide errors while a delete is pending. Every Workspaces tab check readscleanPolicies, so this one change fixes all of them.createPolicyErrorsSelector(WorkspaceRowBrickRoadIndicator.tsx:37-40), returnfalsefor archived policies. Otherwise the row still shows an RBR you can't fix when the "Archived" filter is on.archivedDateand a failed Intacct sync should give no Workspaces tab indicator.Filter on the client, not by clearing the error on the backend. That way the error comes back if the workspace is unarchived.
What alternative solutions did you explore? (Optional)
Have
ArchivePolicyclearconnections.*.lastSyncerrors. I rejected this because unarchiving would hide a real, unresolved sync error.Investigation details
WorkspacesTabButton→useWorkspacesTabIndicatorStatus→usePolicyIndicatorChecks→usePoliciesWithCardFeedErrors().cleanPolicies.isArchivedPolicyis defined atPolicyUtils/index.ts:111-113.isArchivedOrPendingDeletePolicyis atPolicyUtils/index.ts:130-132.useAccountIndicatorChecksreadsisPolicyAdminfrom the same hook. After the change, card feed errors on an archived workspace will no longer hide the employee card feed RBR on the Account tab. That is probably correct.useCardFeedErrorsmay still count feeds from archived workspaces, so check it during the PR.useWorkspaceList) already skips archived policies throughshouldShowPolicy.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/103492)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Oct 8, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cretadn22 (
External)[-]Workspaces - Unable to remove the RBR on archived Workspace[/-][+][$175] Workspaces - Unable to remove the RBR on archived Workspace[/+]melvin-bot commentedon Oct 8, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022108236328767388891
yuvrajangadsingh commentedon Oct 8, 2026
withdrawing this, it went up before the issue had the
Help Wantedlabel. will come back if the label is added.jloa-dev commentedon Oct 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The Red Brick Road (RBR) error indicator remains permanently visible on the Workspaces tab (and on the workspace row in the workspaces list) after a workspace with an accounting sync error (such as bad credentials) is archived, and the user has no way to dismiss or clear it because archived workspaces are read-only.
What is the root cause of that problem?
src/hooks/usePoliciesWithCardFeedErrors.ts,cleanPoliciesfilters policies solely by whether they possess anid:It does not filter out archived policies using
isArchivedPolicy(policy).usePolicyIndicatorChecksiterates throughcleanPoliciesto evaluateshouldShowSyncError(along withshouldShowPolicyError,shouldShowCustomUnitsError,shouldShowEmployeeListError, etc.), the archived workspace is still evaluated:Because neither
shouldShowSyncErrornorcleanPolicieschecks if the policy is archived, the hook returnsHAS_SYNC_ERRORS, keeping the red dot visible inuseWorkspacesTabIndicatorStatus.src/libs/PolicyUtils/index.ts,getPolicyBrickRoadIndicatorStatuslacks an early return check forisArchivedPolicy(policy), which causesWorkspaceRowBrickRoadIndicator.tsxto continue displaying the red indicator on the row even when the workspace is archived.What changes do you think we should make in order to solve the problem?
src/hooks/usePoliciesWithCardFeedErrors.ts:Exclude archived policies when generating
cleanPoliciessousePolicyIndicatorCheckssuppresses error indicators originating from read-only archived workspaces:src/libs/PolicyUtils/index.ts:In
getPolicyBrickRoadIndicatorStatus, returnundefinedimmediately when the policy is archived:src/components/Tables/WorkspaceListTable/WorkspaceRowBrickRoadIndicator.tsx:Add an archived check to
createPolicyErrorsSelector:What alternative solutions did you consider?
shouldShow*Errorfunction to check!isArchivedPolicy(policy): this adds redundant checks across multiple utility functions instead of handling it centrally incleanPolicies,getPolicyBrickRoadIndicatorStatus, and row selector.ashusatyarthi-wq commentedon Oct 9, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a workspace with an accounting sync error (such as invalid Sage Intacct credentials) is archived, the Red Brick Road (RBR) dot remains permanently visible on the Workspaces bottom tab. The user cannot dismiss or resolve the error because archived workspaces are read-only and hidden from standard active settings.
What is the root cause of that problem?
usePolicyIndicatorChecks.tsevaluates all policy errors acrosscleanPolicies.cleanPoliciesis provided byusePoliciesWithCardFeedErrors.ts:nullpolicies that lack anid. It does not filter out archived policies (isArchivedPolicy(policy)).ONYXKEYS.COLLECTION.POLICYwith itserrorsintact andisArchived: true/archivedDateset.cleanPoliciescontinues to include archived policies,policyErrorChecksinusePolicyIndicatorChecks.tsflagsCONST.INDICATOR_STATUS.HAS_SYNC_ERRORSviashouldShowSyncErrorfor the archived workspace, keeping the global Workspaces tab RBR permanently lit.createPolicyErrorsSelectorinWorkspaceRowBrickRoadIndicator.tsxdoes not checkisArchivedPolicy(policy), which leaves the row indicator active on archived workspace rows.What changes do you think we should make in order to solve the problem?
In
src/hooks/usePoliciesWithCardFeedErrors.ts, importisArchivedPolicyfrom@libs/PolicyUtilsand exclude archived policies fromcleanPolicies:This ensures that all global indicator checks in
usePolicyIndicatorChecks.ts(sync errors, card feed errors, QBO export errors, employee list errors, custom units errors, etc.) ignore archived policies.In
src/components/Tables/WorkspaceListTable/WorkspaceRowBrickRoadIndicator.tsx, guardcreatePolicyErrorsSelectoragainst archived policies:What specific scenarios should we cover in automated tests?
tests/unit/usePolicyIndicatorChecksTest.ts:policyErrorStatusofHAS_SYNC_ERRORS.isArchived: true/archivedDateset),policyErrorStatusbecomesundefinedand the RBR indicator is cleared.tests/unit/usePoliciesWithCardFeedErrorsTest.ts:cleanPoliciesexcludes archived policies.tests/unit/WorkspaceRowBrickRoadIndicatorTest.tsx:hasPolicyErrorsisfalse).ashusatyarthi-wq commentedon Oct 9, 2026
Contributor details
Your Expensify account email: ashusatyarthi@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~010e53044b5828fe60
melvin-bot commentedon Oct 9, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
cretadn22 commentedon Oct 9, 2026
I am unable to reproduce this issue
Screen.Recording.2026-10-09.at.23.03.43.mov
@MelvinBot Could you double-check root cause in your proposal? I'm unable to reproduce this on the latest main branch. Do we specifically need to use an expensifail account to trigger this bug?
jloa-dev commentedon Oct 9, 2026
@cretadn22 Yes, exactly! To reproduce the bug, the workspace must have an existing policy/accounting sync error in Onyx before it is archived:
@expensifail.comadmin account is needed because it has access to the Sage Intacct accounting integration.hasPolicyErroron the archived policy in Onyx, leaving the RBR badge permanently visible with no way to remove it.Without that initial failed connection (via the
@expensifail.comtest account) generating the error state prior to archiving, the workspace remains clean and won't surface an RBR.5 remaining items
melvin-bot commentedon Oct 11, 2026
Triggered auto assignment to @deetergp, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
deetergp commentedon Oct 12, 2026
@cretadn22 agreed. Feel free to run with it!
[-][$175] Workspaces - Unable to remove the RBR on archived Workspace[/-][+][Due for payment 2026-11-05] [$175] Workspaces - Unable to remove the RBR on archived Workspace[/+]melvin-bot commentedon Oct 29, 2026
@cretadn22
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.25-2 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-11-05. 🎊
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]
cretadn22 commentedon Oct 30, 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: feat: Replace Delete with Archive behind the archivePolicies beta #98029 (comment)
Link to the comment on the Issue: N/A
[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:
Regression Test Proposal
Test:
Precondition: Enable the archivePolicies beta flag.
Do we agree 👍 or 👎