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
Spend - Category cell for expense in non-default workspace is empty after reset app #99448
Version Number: 9.4.60-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:#99178 Email or phone of affected tester (no customers):sjdonisdjoisdjonjs@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Mac 26.5 / Chrome App Component: Search
Action Performed:
Precondition:
Create two workspaces - A and B.
A is the default workspace.
Invite User B to workspace B.
User B creates an expense without category in workspace B.
Perform the steps below as User A:
Go to staging.new.expensify.com
Go to Account > Troubleshoot > Clear cache and restart > Reset and refresh.
Go to Spend > Expenses. Do not go to Inbox at all.
Please re-state the problem that we are trying to solve in this issue.
The Category selector shows an empty list when a user opens the Category cell of an expense from Spend > Expenses (Search) for an expense in a non-default workspace (a workspace the user is a member of, but that is not their active policy), after a cache reset. Opening the same expense from the Inbox/report works.
What is the root cause of that problem?
The inline Search category picker readspolicyCategories_<policyID> straight from Onyx but never fetches it. For a non-default member workspace on a fresh cache, that Onyx key is never populated (Search snapshots deliberately exclude policy categories), so the list resolves to {} → empty.
The row itself confirms this data isn't in the snapshot — TransactionListItem/index.tsx:127: "Fetch policy categories directly from Onyx since they are not included in the search snapshot."
Nothing in the Search inline-edit path (CategoryCell → CategoryPickerModal → CategoryPicker) calls getPolicyCategories.
By contrast, the RHP category step does fetch, which is why the Inbox/report path is fine: DynamicIOURequestStepCategory.tsx:149-165 runs fetchData() → getPolicyCategories(policyID) (API.read(GET_POLICY_CATEGORIES)) in a useEffect on policyID. The inline Search cell never routes through that component.
What changes do you think we should make in order to solve the problem?
Mirror the RHP fetch pattern in the inline Search path: when the Category picker opens (or the row mounts) and policyCategories_<policyID> is undefined, call getPolicyCategories(policyID). The lowest-risk spot is when CategoryPickerModal/CategoryCell opens, so we only fetch on demand.
Suggested implementation sketch
In CategoryCell.tsx (or CategoryPickerModal on open), add a useEffect that fires when the picker becomes visible:
Reuse the existing guard from DynamicIOURequestStepCategory (skip when policyCategories is already present or offline), and add a loading state so the picker shows a spinner instead of "empty" while the read is in flight.
The GetPolicyCategories READ command already exists and works — this is a frontend-only (Expensify/App) fix, no Auth/Web-Expensify change needed.
What alternative solutions did you explore? (Optional)
Eagerly fetching categories per visible row in TransactionListItem would also fix it but would fire one GetPolicyCategories read per distinct workspace on every Search load — heavier than fetching on demand when the picker opens.
Repro dependency: The empty state only appears on a fresh cache for a non-default workspace, because the active policy's categories are typically already in Onyx from OpenApp; a member-only policy's categories are not.
Live-app verification: A web test run against the Spend > Expenses view loaded the search UI correctly but the test account had no expenses, so the specific empty-category-cell state couldn't be exercised live. Root cause rests on the code path above (high confidence).
Confidence: High for the frontend gap (full file:line chain, and confirmed absence of any getPolicyCategories call in src/components/Search/, useTransactionInlineEdit.ts, and the CategoryPicker/TransactionItemRow components).
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/99448) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
@huult this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
Activity
applause-bot commentedon Aug 25, 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/4078cc882ae20a85d7c1bdd0016be89d183308ba6d0098be465ab389ba59d2de
MelvinBot commentedon Aug 25, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The Category selector shows an empty list when a user opens the Category cell of an expense from Spend > Expenses (Search) for an expense in a non-default workspace (a workspace the user is a member of, but that is not their active policy), after a cache reset. Opening the same expense from the Inbox/report works.
What is the root cause of that problem?
The inline Search category picker reads
policyCategories_<policyID>straight from Onyx but never fetches it. For a non-default member workspace on a fresh cache, that Onyx key is never populated (Search snapshots deliberately exclude policy categories), so the list resolves to{}→ empty.The picker is read-only about this data:
CategoryPicker/index.tsx:64readsPOLICY_CATEGORIES + policyIDfrom Onyx, and:75falls back to{}when it'sundefined.TransactionListItem/index.tsx:127: "Fetch policy categories directly from Onyx since they are not included in the search snapshot."CategoryCell→CategoryPickerModal→CategoryPicker) callsgetPolicyCategories.By contrast, the RHP category step does fetch, which is why the Inbox/report path is fine:
DynamicIOURequestStepCategory.tsx:149-165runsfetchData()→getPolicyCategories(policyID)(API.read(GET_POLICY_CATEGORIES)) in auseEffectonpolicyID. The inline Search cell never routes through that component.What changes do you think we should make in order to solve the problem?
Mirror the RHP fetch pattern in the inline Search path: when the Category picker opens (or the row mounts) and
policyCategories_<policyID>isundefined, callgetPolicyCategories(policyID). The lowest-risk spot is whenCategoryPickerModal/CategoryCellopens, so we only fetch on demand.Suggested implementation sketch
In
CategoryCell.tsx(orCategoryPickerModalon open), add auseEffectthat fires when the picker becomes visible:Reuse the existing guard from
DynamicIOURequestStepCategory(skip whenpolicyCategoriesis already present or offline), and add a loading state so the picker shows a spinner instead of "empty" while the read is in flight.The
GetPolicyCategoriesREAD command already exists and works — this is a frontend-only (Expensify/App) fix, no Auth/Web-Expensify change needed.What alternative solutions did you explore? (Optional)
Eagerly fetching categories per visible row in
TransactionListItemwould also fix it but would fire oneGetPolicyCategoriesread per distinct workspace on every Search load — heavier than fetching on demand when the picker opens.Investigation notes & related issues
getPolicyCategoriescall insrc/components/Search/,useTransactionInlineEdit.ts, and theCategoryPicker/TransactionItemRowcomponents).Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/99448)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 Aug 25, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @huult (
External)melvin-bot commentedon Aug 25, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
bernhardoj commentedon Aug 26, 2026
I think dupe of #98838
huult commentedon Aug 27, 2026
Agree. This ticket is similar to #98838, so we should hold it until #98838 is resolved and then retest.
melvin-bot commentedon Sep 1, 2026
@huult Huh... This is 4 days overdue. Who can take care of this?
huult commentedon Sep 2, 2026
Same as above
melvin-bot commentedon Sep 7, 2026
@huult Huh... This is 4 days overdue. Who can take care of this?
huult commentedon Sep 8, 2026
Same as above
melvin-bot commentedon Sep 8, 2026
@huult this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
huult commentedon Sep 9, 2026
Same as above
mountiny commentedon Sep 9, 2026
Closing this in favour of #98838