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-10-23] [$175] Edit multiple hides the Category and Reimbursable rows after Clear cache until each expense detail is opened #101733
Version Number: 9.4.90-1 Reproducible in staging?: Needs Reproduction (Unable to reproduce) Reproducible in production?: Needs Reproduction If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@suneox Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Preconditions: A workspace with at least 2 draft expenses that have no category
Settings → Troubleshoot → Clear cache and restart.
Go straight to the Search expenses drafts page (do not open any expense first).
Select 2 or more draft expenses → Edit multiple.
Category and Reimbursable rows are missing from the menu.
Open each selected expense's detail → go back, select the same expenses → Edit multiple → both rows are back.
Expected Result:
The Edit multiple menu shows all applicable fields immediately, regardless of whether any expense detail was opened beforehand.
Actual Result:
Both rows are hidden, and no error is shown. They only reappear after opening each selected expense's detail.
Workaround: open each selected expense's detail once before bulk editing.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
The bulk-edit menu decides which rows to show from policy data that the Search flow never loads. On a cold cache that data is absent, so the two rows that require it are silently dropped. Opening each expense fires OpenReport, which hydrates the data — which is why the workaround works.
SearchEditMultiplePage is registered as an RHP modal screen, so it renders outsideSearchScopeProvider. useIsOnSearch() therefore returns the default false, and every useOnyx call on the page reads live Onyx with no snapshot fallback. The page already knows this — it hand-merges snapshot data for transactions, reports and report actions in SearchEditMultipleUtils.ts:130-181, under a comment describing exactly this scenario. It does not do the same for policy data.
Category — SearchEditMultiplePage.tsx:164 requires hasEnabledOptions(policyCategories ?? {}). policyCategories_ is not in SEARCH_SNAPSHOT_ONYX_KEYS, so it is not in the snapshot, and no screen under src/pages/Search or src/components/Search ever fetches it. The ?? {} collapses "not fetched yet" into "fetched, none enabled", so the row disappears instead of loading.
Reimbursable — SearchEditMultiplePage.tsx:151 gates on transactionPolicy?.disabledFields?.reimbursable === false. That strict === false demands a fully hydrated policy: a missing policy_<id>, a policy without disabledFields, or an unresolvable report.policyID all evaluate to undefined === false and hide the row. Everywhere else in the repo the same concept is written !== true, which degrades safely — see MoneyRequestView.tsx:536 and useFooterDerivedFlags.ts:97-98. === false appears on exactly two lines in the whole codebase, both on this page.
What changes do you think we should make in order to solve the problem?
Fetch the policy data on this page. After policyID is derived at line 154, call openPolicyCategoriesPage / openPolicyTagsPage when the policy enables them and the Onyx value is still undefined, re-armed on reconnect. Copy the pattern from MerchantRulePageBase.tsx:234-250 — its comment names this exact failure — or DynamicSplitExpenseEditPage.tsx:140-155, which is an RHP edit page that hit the same gap coming from Search.
Distinguish "not fetched" from "empty". While policyCategories/policyTags are undefined and the user is online, show a loading state instead of a menu with rows missing — the three-branch convention in DynamicIOURequestStepCategory.tsx:161-163.
Relax the Reimbursable gate to !== true, matching the rest of the codebase. Line 143 (Billable) has the same inverted polarity and should change with it.
What alternative solutions did you explore? (Optional)
Adding a withSnapshotPolicies helper alongside the existing merge helpers. This does not work on its own: the snapshot's policy record is trimmed (the CategoryPicker deliberately bypasses snapshot policies for that reason), and policyCategories_ is not in the snapshot at all — so the data still has to be fetched.
Opening each expense fires OpenReport, whose response hydrates the policy and its categories → both rows return.
The App even documents the snapshot gap inline: "Fetch policy categories directly from Onyx since they are not included in the search snapshot" — TransactionListItem/index.tsx:127.
Two related gaps worth covering in the same PR
The Tag row has identical exposure — policyTags_ is also absent from the snapshot and gates line 165. The reporter likely had no tags enabled.
SearchEditMultipleCategoryPage / SearchEditMultipleTagPage don't fetch either, so under the same conditions their pickers render empty.
Confidence: High on Category — the snapshot key list, the absence of any fetch in Search, and the ?? {} collapse are all conclusive from the code. Medium on Reimbursable — the strict === false provably hides the row whenever policy data is incomplete, but I could not read the backend to confirm which field (policy_<id>.disabledFields vs. an unresolved report.policyID) is the one missing after a cache clear. Both are fixed by the !== true change.
Reproduction: not attempted in the automated web environment — the pre-provisioned test session was already in an unrecoverable blank state from a failed onboarding replay, so this analysis is static only. A manual check of whether the Billable row behaves the same way in the broken state would narrow the Reimbursable half further.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/101733) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Please re-state the problem that we are trying to solve in this issue.
In Search, after clearing cache and selecting 2 or more draft expenses, opening "Edit multiple" hides the Category and Reimbursable options. They only reappear after opening the details of each selected expense.
What is the root cause of that problem?
SearchEditMultiplePage renders in the RHP modal outside SearchScopeProvider (useIsOnSearch() is false), so all useOnyx calls on the page read live Onyx keys without the search snapshot fallback. This creates two distinct root causes:
Missing Category/Tag hydration & pessimistic collapse in SearchEditMultiplePage.tsx:171-172: policyCategories_ and policyTags_ are not part of SEARCH_SNAPSHOT_ONYX_KEYS, and no Search screen loads them.
In SearchEditMultiplePage.tsx:171:
When cache is cleared, policyCategories is undefined. The fallback ?? {} causes hasEnabledOptions({}) to evaluate to false (collapsing "not yet loaded" to "none enabled"), dropping the Category row. SearchEditMultiplePage also never calls openPolicyCategoriesPage or openPolicyTagsPage to fetch this data. Opening an individual expense runs OpenReport, which hydrates the policy categories/tags and causes the rows to reappear.
Strict === false comparison on unhydrated policy fields (SearchEditMultiplePage.tsx:150, 158):
The strict === false checks require transactionPolicy and its disabledFields to be already fully populated. If transactionPolicy is unhydrated, undefined === false evaluates to false, silently hiding the Reimbursable and Billable rows. Throughout the rest of the codebase (e.g., MoneyRequestView.tsx, useFooterDerivedFlags.ts), disabled fields are checked with !== true to safely default to enabled when data is hydrating.
What changes do you think we should make in order to solve the problem?
Hydrate missing policy categories and tags in SearchEditMultiplePage.tsx:
Add a useEffect to fetch categories and tags when the workspace has them enabled and they are not yet in Onyx:
What alternative solutions did you explore? (Optional)
Including policyCategories_ in the Search snapshot was considered, but snapshots are intended to be lightweight summaries for the Search table and avoid bloating storage with entire category trees for all policies. Triggering openPolicyCategoriesPage / openPolicyTagsPage directly on SearchEditMultiplePage when entering bulk edit is lightweight, on-demand, and aligns with other RHP flows (MerchantRulePageBase, DynamicSplitExpenseEditPage).
Fetch the policy data on this page. After policyID is derived at line 154, call openPolicyCategoriesPage / openPolicyTagsPage when the policy enables them and the Onyx value is still undefined, re-armed on reconnect. Copy the pattern from MerchantRulePageBase.tsx:234-250 — its comment names this exact failure — or DynamicSplitExpenseEditPage.tsx:140-155, which is an RHP edit page that hit the same gap coming from Search.
[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:
Link to the comment on the Issue:
[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
Precondition:
Test:
Preconditions: A workspace with at least two draft expenses that have no category.
Go to Settings → Troubleshoot → Clear cache and restart.
Navigate directly to the Search → Drafts page without opening any expenses first.
Select two or more draft expenses and click Edit multiple.
Verify that the Category and Reimbursable rows eventually appear. They may take a few moments to load while waiting for data from the backend.
Activity
MelvinBot commentedon Sep 21, 2026
Proposal
What is the root cause of that problem?
The bulk-edit menu decides which rows to show from policy data that the Search flow never loads. On a cold cache that data is absent, so the two rows that require it are silently dropped. Opening each expense fires
OpenReport, which hydrates the data — which is why the workaround works.SearchEditMultiplePageis registered as an RHP modal screen, so it renders outsideSearchScopeProvider.useIsOnSearch()therefore returns the defaultfalse, and everyuseOnyxcall on the page reads live Onyx with no snapshot fallback. The page already knows this — it hand-merges snapshot data for transactions, reports and report actions inSearchEditMultipleUtils.ts:130-181, under a comment describing exactly this scenario. It does not do the same for policy data.Category —
SearchEditMultiplePage.tsx:164requireshasEnabledOptions(policyCategories ?? {}).policyCategories_is not inSEARCH_SNAPSHOT_ONYX_KEYS, so it is not in the snapshot, and no screen undersrc/pages/Searchorsrc/components/Searchever fetches it. The?? {}collapses "not fetched yet" into "fetched, none enabled", so the row disappears instead of loading.Reimbursable —
SearchEditMultiplePage.tsx:151gates ontransactionPolicy?.disabledFields?.reimbursable === false. That strict=== falsedemands a fully hydrated policy: a missingpolicy_<id>, a policy withoutdisabledFields, or an unresolvablereport.policyIDall evaluate toundefined === falseand hide the row. Everywhere else in the repo the same concept is written!== true, which degrades safely — seeMoneyRequestView.tsx:536anduseFooterDerivedFlags.ts:97-98.=== falseappears on exactly two lines in the whole codebase, both on this page.What changes do you think we should make in order to solve the problem?
Fetch the policy data on this page. After
policyIDis derived at line 154, callopenPolicyCategoriesPage/openPolicyTagsPagewhen the policy enables them and the Onyx value is stillundefined, re-armed on reconnect. Copy the pattern fromMerchantRulePageBase.tsx:234-250— its comment names this exact failure — orDynamicSplitExpenseEditPage.tsx:140-155, which is an RHP edit page that hit the same gap coming from Search.Distinguish "not fetched" from "empty". While
policyCategories/policyTagsareundefinedand the user is online, show a loading state instead of a menu with rows missing — the three-branch convention inDynamicIOURequestStepCategory.tsx:161-163.Relax the Reimbursable gate to
!== true, matching the rest of the codebase. Line 143 (Billable) has the same inverted polarity and should change with it.What alternative solutions did you explore? (Optional)
Adding a
withSnapshotPolicieshelper alongside the existing merge helpers. This does not work on its own: the snapshot's policy record is trimmed (theCategoryPickerdeliberately bypasses snapshot policies for that reason), andpolicyCategories_is not in the snapshot at all — so the data still has to be fetched.Supporting evidence, related gaps, and confidence
Failure chain
OpenAppruns;policyCategories_is empty.snapshot_<hash>written withreport_,policy_,transactions_,reportActions_— nopolicyCategories_.SearchEditMultiplePagemounts in the RHP, outsideSearchScopeProvider(defaultisOnSearch: false,shouldUseSnapshotrequires it).policyCategories→undefined;hasEnabledOptions({})→false→ Category row omitted.transactionPolicy.disabledFieldsunresolved → Reimbursable row omitted.OpenReport, whose response hydrates the policy and its categories → both rows return.The App even documents the snapshot gap inline: "Fetch policy categories directly from Onyx since they are not included in the search snapshot" —
TransactionListItem/index.tsx:127.Two related gaps worth covering in the same PR
policyTags_is also absent from the snapshot and gates line 165. The reporter likely had no tags enabled.SearchEditMultipleCategoryPage/SearchEditMultipleTagPagedon't fetch either, so under the same conditions their pickers render empty.Confidence: High on Category — the snapshot key list, the absence of any fetch in Search, and the
?? {}collapse are all conclusive from the code. Medium on Reimbursable — the strict=== falseprovably hides the row whenever policy data is incomplete, but I could not read the backend to confirm which field (policy_<id>.disabledFieldsvs. an unresolvedreport.policyID) is the one missing after a cache clear. Both are fixed by the!== truechange.Reproduction: not attempted in the automated web environment — the pre-provisioned test session was already in an unrecoverable blank state from a failed onboarding replay, so this analysis is static only. A manual check of whether the Billable row behaves the same way in the broken state would narrow the Reimbursable half further.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/101733)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run · no recording available
melvin-bot commentedon Sep 21, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @truph01 (
External)melvin-bot commentedon Sep 21, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
melvin-bot commentedon Sep 24, 2026
@truph01 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
ashusatyarthi-wq commentedon Sep 26, 2026
Contributor details
Your Expensify account email: ashu.satyarthi.business@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~01b8ab177d61dc225cProposal
Please re-state the problem that we are trying to solve in this issue.
In Search, after clearing cache and selecting 2 or more draft expenses, opening "Edit multiple" hides the Category and Reimbursable options. They only reappear after opening the details of each selected expense.
What is the root cause of that problem?
SearchEditMultiplePagerenders in the RHP modal outsideSearchScopeProvider(useIsOnSearch()isfalse), so alluseOnyxcalls on the page read live Onyx keys without the search snapshot fallback. This creates two distinct root causes:Missing Category/Tag hydration & pessimistic collapse in
SearchEditMultiplePage.tsx:171-172:policyCategories_andpolicyTags_are not part ofSEARCH_SNAPSHOT_ONYX_KEYS, and no Search screen loads them.In
SearchEditMultiplePage.tsx:171:When cache is cleared,
policyCategoriesisundefined. The fallback?? {}causeshasEnabledOptions({})to evaluate tofalse(collapsing "not yet loaded" to "none enabled"), dropping the Category row.SearchEditMultiplePagealso never callsopenPolicyCategoriesPageoropenPolicyTagsPageto fetch this data. Opening an individual expense runsOpenReport, which hydrates the policy categories/tags and causes the rows to reappear.Strict
=== falsecomparison on unhydrated policy fields (SearchEditMultiplePage.tsx:150, 158):The strict
=== falsechecks requiretransactionPolicyand itsdisabledFieldsto be already fully populated. IftransactionPolicyis unhydrated,undefined === falseevaluates tofalse, silently hiding the Reimbursable and Billable rows. Throughout the rest of the codebase (e.g.,MoneyRequestView.tsx,useFooterDerivedFlags.ts), disabled fields are checked with!== trueto safely default to enabled when data is hydrating.What changes do you think we should make in order to solve the problem?
Hydrate missing policy categories and tags in
SearchEditMultiplePage.tsx:Add a
useEffectto fetch categories and tags when the workspace has them enabled and they are not yet in Onyx:Do not collapse
undefinedpolicy categories/tags to disabled:While the data is loading, preserve the options if enabled by the policy:
Align
disabledFieldschecks with codebase standard (!== true):In
SearchEditMultiplePage.tsx:What alternative solutions did you explore? (Optional)
Including
policyCategories_in the Search snapshot was considered, but snapshots are intended to be lightweight summaries for the Search table and avoid bloating storage with entire category trees for all policies. TriggeringopenPolicyCategoriesPage/openPolicyTagsPagedirectly onSearchEditMultiplePagewhen entering bulk edit is lightweight, on-demand, and aligns with other RHP flows (MerchantRulePageBase,DynamicSplitExpenseEditPage).melvin-bot commentedon Sep 28, 2026
@truph01 Still overdue 6 days?! Let's take care of this!
truph01 commentedon Sep 30, 2026
Melvin's proposal looks good!
🎀 👀 🎀 C+ reviewed
25 remaining items
truph01 commentedon Oct 20, 2026
Contributor+ 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:
Link to the comment on the Issue:
[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
Precondition:
Test:
Preconditions: A workspace with at least two draft expenses that have no category.
Do we agree 👍 or 👎
melvin-bot commentedon Oct 22, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Oct 22, 2026
Payment Summary
Resolving PRs:
Fetch policy categories and tags on the Search Edit multiple page #102812
Reviewer: @truph01 owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Oct 26, 2026
Payment Summary
Contributor+: @truph01 due $175 via NewDot