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-08-10] [$250] Spends - feed:xxxx auto selected to Bank Account instead of Expensify Card #96342
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: undefined Reproducible in staging?: Yes Reproducible in production?:https://github.com/Expensify/Expensify/issues/557015 If this was caught during regression testing, add the test name, ID and link from BrowserStack: undefined Email or phone of affected tester (no customers): undefined Issue reported by: Applause Internal Team Bug source: undefined Device used: undefined App Component: undefined
Action Performed:
Precondition:
Workspace is set up with Expensify Card feature.
Assign at least one card to any user.
Steps:
Open the app
Go to Spends
Click Card accruals
Expected Result:
search query shows "feed:Expensify Card"
Actual Result:
feed:xxxx auto selected to Region Bank instead of Expensify Card
Please re-state the problem that we are trying to solve in this issue.
On the Spends (Reports) page, clicking the "Card accruals" suggested search auto-fills the query with the account's company card feed (e.g. feed:Region Bank) instead of the workspace's Expensify Card feed, even though the workspace has the Expensify Card set up with assigned cards.
What is the root cause of that problem?
In src/hooks/useSearchTypeMenuSections.ts (line 111, against origin/main), the feed passed to createTypeMenuSections is defaultCardFeed: defaultCardFeed ?? defaultExpensifyCard, where defaultCardFeed comes from useCardFeedsForDisplay() which only aggregates company card feeds from SHARED_NVP_PRIVATE_DOMAIN_MEMBER — Expensify Card feeds are never part of that list (they are derived separately via defaultExpensifyCardSelector in src/selectors/Card.ts:78). Because of the nullish coalescing, whenever the account has any company card feed (Region Bank here), it always wins and the Expensify Card feed is only ever used when there are zero company feeds. That feed ID then flows into getSuggestedSearches → the UNAPPROVED_CARD item's feed: [defaultFeedID] (src/libs/SearchUIUtils.ts:914), producing feed:Region Bank in the query.
What changes do you think we should make in order to solve the problem?
In src/hooks/useSearchTypeMenuSections.ts:111, swap the precedence so the workspace's Expensify Card feed is preferred when one exists:
The same fallback should also be applied in src/components/Search/SearchQueryProvider.tsx:44-47, which currently calls getSuggestedSearches(accountID, defaultCardFeedID) using only useCardFeedsForDisplay()'s company feed with no Expensify Card fallback at all — leaving it inconsistent would make the suggested-search hashes computed there (used for matching/highlighting the active suggested search) disagree with the menu items built in useSearchTypeMenuSections, so "Card accruals" would stop being recognized as the active tab. No API/backend change is involved — the feed: filter already accepts Expensify Card feed IDs (the same IDs built by getExpensifyCardFeedsForDisplay in src/libs/CardFeedUtils.ts:152 are already selectable in the search feed filter).
What alternative solutions did you explore? (Optional)
Merging Expensify Card feeds into cardFeedsByPolicy inside useCardFeedsForDisplay/getDefaultCardFeed so alphabetical/policy-priority sorting picks them naturally — rejected because that hook feeds other company-card-only UI and the refactor is much larger than needed for this bug.
The Card accruals item under Spends is the UNAPPROVED_CARD suggested search. Its query hard-codes a single feed: value, and that value is picked from the wrong source, so it lands on a company-card feed (e.g. Region Bank) instead of the Expensify Card.
The feed passed into the suggested search is defaultCardFeed ?? defaultExpensifyCard at src/hooks/useSearchTypeMenuSections.ts:111. The problem is that defaultCardFeednever contains the Expensify Card — by design, getCardFeedsForDisplayPerPolicy excludes Expensify Card feeds (src/libs/CardFeedUtils.ts:227). So as soon as the workspace has any company-card feed, defaultCardFeed is truthy, the ?? short-circuits, and defaultExpensifyCard is never used. The Expensify Card can only be selected when there are zero company feeds.
That is why the tester — who has both an Expensify Card and a Region Bank company feed — gets feed:Region Bank rather than feed:Expensify Card.
The defaultCardFeed given to createTypeMenuSections is defaultCardFeed ?? defaultExpensifyCard — useSearchTypeMenuSections.ts:111.
getDefaultCardFeed returns the alphabetically-first company feed and only falls through to commercial feeds — it has no notion of the Expensify Card — useCardFeedsForDisplay.ts:26-56.
getCardFeedsForDisplayPerPolicy explicitly notes "Expensify Card feeds are not included (handled by the Expensify card selector)" — CardFeedUtils.ts:227.
So the ?? fallback is effectively backwards: it prefers the (non-Expensify) company feed and treats the Expensify Card as the last resort.
What changes do you think we should make in order to solve the problem?
For the Card accruals (UNAPPROVED_CARD) default feed, prefer the Expensify Card when the workspace has Expensify Cards enabled — i.e. flip the fallback order so defaultExpensifyCard wins over defaultCardFeed at useSearchTypeMenuSections.ts:111, or pass a dedicated default feed for the accruals search rather than reusing the general company-card default.
⚠️ One thing worth confirming before implementing: which feed should be the default here is a product decision. The current defaultCardFeed ?? defaultExpensifyCard ordering looks intentional (Expensify Card as fallback), so please confirm the intended default is Expensify Card when both exist — the fix is a one-line reorder either way, but the expected behavior should be nailed down first.
What alternative solutions did you explore? (Optional)
Leave the feed unset (feed: ['']) so Card accruals shows all card feeds and the user picks — but that changes the current single-feed UX and likely isn't what's wanted.
Possibly related (not duplicates)
Expensify/App#91790 — [Exploratory] Spend-Card accruals highlight disappears after changing filters — same Card accruals area but about highlight/selection state, not the feed default.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/96342) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Note for the reviewer: this proposal was auto-withdrawn by ProposalPolice as a suspected duplicate — it isn't one. It was posted right after the External assignment, and the auto-withdrawal is a false positive: the earlier proposals all stop at the ?? precedence and suggest flipping it to defaultExpensifyCard ?? defaultCardFeed. That flip is itself buggy for the reason below (global vs active-policy scoping), so this proposal identifies a different root cause and a different fix. Re-posting so the distinct approach stays on record.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Spends page, opening the Card accruals suggested search builds a query whose feed: filter auto-selects a company/bank card feed (e.g. feed:Region Bank) instead of the workspace's Expensify Card feed. On a workspace that runs the Expensify Card, the expected query is feed:Expensify Card.
What is the root cause of that problem?
The Card accruals (UNAPPROVED_CARD) search takes its feed from a single pre-merged value built here:
The value passed as defaultCardFeed is defaultCardFeed ?? defaultExpensifyCard. Because a company feed (Region Bank) is truthy whenever it exists, the ?? short-circuits and the Expensify Card is only ever used on workspaces that have zero company feeds. That merged id flows through createTypeMenuSections → getSuggestedSearches and becomes the feed: of Card accruals:
So far this matches what others noticed. But the important part — and why simply flipping the ?? is wrong — is that the two operands are resolved with different scoping:
defaultCardFeed is active-policy-scoped. getDefaultCardFeed prioritizes the active policy's feeds, and only falls through to other eligible/commercial feeds:
defaultExpensifyCard is global. Its selector picks the first non-travel Expensify Card feed across the entire NON_PERSONAL_AND_WORKSPACE_CARD_LIST — every workspace the user belongs to, with no active-policy notion:
That mismatch is the real root cause. A blanket defaultExpensifyCard ?? defaultCardFeed flip would fix the reported case but silently regress a mixed setup: a user whose active workspace uses company cards, but who also belongs to another workspace with an Expensify Card, would get that other workspace's Expensify Card injected into Card accruals. The feed must be resolved for the relevant policy, not merely preferred by truthiness.
What changes do you think we should make in order to solve the problem?
Stop pre-merging in the hook, and resolve a dedicated Card-accruals feed that prefers the Expensify Card only when the active policy actually runs the Expensify Card program, falling back to the company feed otherwise.
In useSearchTypeMenuSections, compute the accruals feed explicitly instead of the ?? merge:
// prefer the Expensify Card feed only when the active workspace runs the Expensify CardconstactivePolicyHasExpensifyCard=!!allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${activePolicyID}`]?.areExpensifyCardsEnabled;constunapprovedCardFeedID=activePolicyHasExpensifyCard&&defaultExpensifyCard ? defaultExpensifyCard.id : defaultCardFeed?.id;
Pass defaultCardFeed unchanged (drop the ?? defaultExpensifyCard) and thread unapprovedCardFeedID through to getSuggestedSearches, which uses it for the UNAPPROVED_CARD item only:
STATEMENTS stays on defaultFeedID (the company feed), so its behaviour is unchanged. The same unapprovedCardFeedID must also be computed and passed in SearchQueryProvider, which builds the suggested searches a second time — otherwise its similarSearchHash won't match the menu item and the Card accruals tile won't highlight as active:
To keep the two call sites from drifting, the resolution can live in one small helper next to getDefaultCardFeed and be called from both.
What specific scenarios should we cover in automated tests to prevent this from happening again?
Unit-test the UNAPPROVED_CARD query from getSuggestedSearches:
Active policy has Expensify Card + a company feed exists → feed is the Expensify Card feed id (the issue's expected result).
Active policy has only a company feed → feed is the company feed id.
Active policy is company-card-only but another workspace has an Expensify Card → feed is the active workspace's company feed, not the other workspace's Expensify Card (guards the scoping regression the naive ?? flip introduces).
No card feeds at all → feed is [''].
What alternative solutions did you explore? (Optional)
Flipping the merge to defaultExpensifyCard ?? defaultCardFeed at useSearchTypeMenuSections.ts:111. Rejected: it fixes the single-workspace case but regresses the multi-workspace case above, because defaultExpensifyCard is global while defaultCardFeed is active-policy-scoped. Including Expensify Card feeds inside getCardFeedsForDisplayPerPolicy so getDefaultCardFeed returns one was also rejected — that exclusion is intentional and shared by the company-cards admin selectors, so it has a wide blast radius for a one-search bug.
When building the feed:xxxx search query for Card Accruals, the code that selects which card feed to use likely picks the first feed from the list of available card feeds without prioritizing the Expensify Card feed over regular bank account feeds. This means if a bank/region feed appears before the Expensify Card feed in the data structure, it gets selected instead.
The relevant logic is likely in src/libs/SearchQueryUtils.ts (or a similar query-building utility) where card feeds are resolved to a feed identifier.
What changes do you think we should make in order to solve the problem?
When selecting the default card feed for the feed:xxxx query, we should prioritize feeds whose key/type indicates an Expensify Card (e.g., feed key starts with Expensify or matches CONST.EXPENSIFY_CARD.BANK / CONST.EXPENSIFY_CARD_BANK_NAME) over other bank feeds.
This ensures the Expensify Card feed is preferred when constructing the search query, falling back to the first available feed only if no Expensify Card feed exists.
What alternative solutions did you explore?
I considered sorting feeds so Expensify Card always comes first universally, but that could have unintended side effects in other places that rely on feed ordering. A targeted fix at query-construction time is safer and more explicit.
Note: This proposal is not a duplicate. It changes a different location in the code to address the issue.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Web, when a workspace has both an Expensify Card feed (with at least one card assigned to a user) and a commercial/bank card feed (e.g. Region Bank), navigating to Spends → Card accruals populates the search with feed:<bank-feed-id> (Region Bank) instead of feed:Expensify Card. Expected: the Card accruals suggested search should default the feed to the workspace's Expensify Card feed when the user has assigned Expensify cards.
What is the root cause of that problem?
The feed: value for the "Card accruals" (UNAPPROVED_CARD) suggested search is built in src/libs/SearchUIUtils.ts:914 as feed: defaultFeedID ? [defaultFeedID] : [''], where defaultFeedID is defaultCardFeed?.id from useCardFeedsForDisplay (src/components/Search/SearchQueryProvider.tsx:47 and src/libs/SearchUIUtils.ts:4605). The producer of that id, getDefaultCardFeed in src/hooks/useCardFeedsForDisplay.ts:26-56, picks the first feed of the active/eligible policy strictly by localeCompare(name) (lines 38, 46, 55) and never prefers an Expensify Card feed over a commercial bank feed — even though defaultExpensifyCard is already computed separately and passed alongside (SearchUIUtils.ts:4605, gating card-accrual visibility at line 1116). So when the active policy has both an Expensify Card feed and a bank feed, whichever sorts first by name wins, which is why "Region Bank" is auto-selected instead of "Expensify Card".
What changes do you think we should make in order to solve the problem?
In src/hooks/useCardFeedsForDisplay.ts (getDefaultCardFeed, lines 26–56), when iterating the active policy's feeds (lines 35–40) and the eligible-policy fallback (lines 43–48), prefer an Expensify Card feed (detectable via the existing CardUtils helpers used for Expensify feed types) over commercial/bank feeds before falling back to the alphabetical localeCompare tiebreak.
Alternatively (or additionally), in src/libs/SearchUIUtils.ts:4605, when defaultExpensifyCard exists for the current context, pass defaultExpensifyCard.id (not defaultCardFeed?.id) as the defaultFeedID to getSuggestedSearches for the UNAPPROVED_CARD key, so the Card accruals suggestion always seeds with the Expensify Card feed when one is available.
Update getSuggestedSearches in [src/libs/SearchUIUtils.ts:722](https://github.com/Expensify/App/blob/d769fd57fb65190d73383950d7120d6f6189717e/src/libs/SearchUIUtils.ts#L722)–930 to accept a distinct defaultExpensifyCardFeedID (or reuse defaultExpensifyCard) and use it at line 914 for the UNAPPROVED_CARD entry, keeping defaultFeedID for the statements entry at line 866 unchanged.
Add a unit test around getDefaultCardFeed / getSuggestedSearches[UNAPPROVED_CARD].searchQuery covering the "policy has both Expensify Card feed and bank feed" case, asserting the resulting query contains the Expensify Card feed id.
What alternative solutions did you explore? (Optional)
🚨 Edited by proposal-police: This proposal was edited at 2026-07-20 13:34:52 UTC.
Proposal (updated)
Updated per @joekaufmanexpensify's confirmation of the expected behavior. Two additions vs. my earlier proposal: I now also update the second getSuggestedSearches call site (SearchQueryProvider) so the tab still highlights, and I scope the Expensify Card to the active workspace to avoid a mixed-workspace regression.
Please re-state the problem that we are trying to solve in this issue.
On a workspace that has both a company/bank card feed and the Expensify Card set up, clicking Card accruals from Spends opens a search with the company feed pre-selected (feed:Region Bank) instead of feed:Expensify Card.
Per @joekaufmanexpensify, the confirmed expected behavior is: Card accruals should default to the active workspace's Expensify Card whenever it is available, even when other third-party feeds exist — consistent with the Classic domains page and NewDot bank reconciliation, which both default to the Expensify Card when present.
What is the root cause of that problem?
The Card accruals (UNAPPROVED_CARD) search fills its feed: filter from a single defaultFeedID:
That id comes from defaultCardFeed ?? defaultExpensifyCard in useSearchTypeMenuSections.ts:111. The two operands are not peers: defaultCardFeed is drawn from cardFeedsByPolicy, which by design excludes Expensify Card feeds (getCardFeedsForDisplayPerPolicy, CardFeedUtils.ts — "Expensify Card feeds are not included"). So defaultCardFeed can only ever be a company feed, and the ?? reaches defaultExpensifyCardonly when there is no company feed at all. As soon as any company feed exists, it wins — which is the reported bug.
What changes do you think we should make in order to solve the problem?
Resolve a dedicated feed id for Card accruals that prefers the active workspace's Expensify Card, and thread it through both places that build the suggested searches so they stay in sync.
Resolve the active workspace's Expensify Card feed id.defaultExpensifyCardSelector (Card.ts:78) is global, so don't use it directly. Pick the Expensify Card feed whose fundID maps to the active policy (the same fundID ↔ policyAccountID linkage getCardFeedsForDisplayPerPolicy already uses for orphan feeds). Call it activeExpensifyCardFeedID.
Prefer it only for UNAPPROVED_CARD. Add a dedicated parameter to getSuggestedSearches and use it for the Card accruals feed, leaving defaultFeedID (the company feed) for the Statements entry unchanged:
Update both call sites so their hashes agree. Pass activeExpensifyCardFeedID from the menu builder (SearchUIUtils.ts:4605) and from SearchQueryProvider.tsx:47, which today passes only the company feed id. Without the second update, the menu item's feed and the provider's computed similarSearchHash disagree, so the Card accruals tab won't highlight as active.
No API/backend change — the feed: filter already accepts Expensify Card feed ids.
What specific scenarios should we cover in automated tests to prevent this from happening again?
Active workspace has an Expensify Card and a company feed → Card accruals feed is the Expensify Card id (the reported case).
Active workspace has only a company feed → feed stays the company feed id.
Active workspace is company-only but another workspace has an Expensify Card → feed stays the active workspace's company feed, not the other workspace's Expensify Card (guards the global-scoping regression).
No card feeds → feed is [''].
The Card accruals tab is recognized as active (its similarSearchHash from SearchQueryProvider matches the menu item).
What alternative solutions did you explore? (Optional)
Flip to defaultExpensifyCard ?? defaultCardFeed. Rejected: fixes the repro but regresses mixed multi-workspace setups, because defaultExpensifyCard is global while defaultCardFeed is active-policy-scoped — a user in a company-card workspace who also belongs to an Expensify-Card workspace would get the wrong workspace's card.
Include Expensify Card feeds in getCardFeedsForDisplayPerPolicy / rewrite getDefaultCardFeed. Rejected: that exclusion is intentional and shared by company-card admin UI, so the blast radius is far wider than this one search.
When an admin opens Spends and taps the "Card accruals" row, NewDot builds a Search query whose feed: filter is meant to point at the Expensify Card feed. Instead the query resolves to a commercial bank feed (Region Bank), so the header shows feed:xxxx for a bank account rather than feed:Expensify Card.
The feed used to build the card menu items comes from useSearchTypeMenuSections, which passes defaultCardFeed into createTypeMenuSections with this fallback order:
Here defaultCardFeed comes from useCardFeedsForDisplay() and defaultExpensifyCard comes from the NON_PERSONAL_AND_WORKSPACE_CARD_LIST derived selector. Because the value passed is defaultCardFeed ?? defaultExpensifyCard, any generic default card feed (which can be a commercial bank feed such as Region Bank) takes priority over the Expensify Card feed. So on a workspace that has both an assigned Expensify Card and a bank feed, the Expensify-Card-specific accruals item inherits the bank feed, which is why feed: auto-selects Region Bank instead of Expensify Card.
What changes do you think we should make in order to solve the problem?
In useSearchTypeMenuSections.ts, the Expensify Card accruals item must be built from defaultExpensifyCard, not from the generic defaultCardFeed ?? defaultExpensifyCard value that prefers bank feeds.
Today defaultExpensifyCard is already read from the derived card list selector, but it is only used as a fallback. Pass it through as its own argument so createTypeMenuSections can build the Expensify Card accruals query from the Expensify Card feed specifically:
In createTypeMenuSections (inside SearchUIUtils.ts), when constructing the Expensify Card accruals menu item, use the new defaultExpensifyCard argument to build its feed: filter instead of the shared defaultCardFeed.
This keeps generic card sections using defaultCardFeed while ensuring the accruals row that is meant for the Expensify Card always resolves to the Expensify Card feed, which fixes the wrong feed:Region Bank selection.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-16 18:49:34 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On a workspace that has the Expensify Card feature enabled and at least one card assigned, opening Spends → Card accruals builds a search query that auto-selects a company card feed (e.g. feed:Regions Bank) instead of feed:Expensify Card.
What is the root cause of that problem?
The Card accruals suggested search takes its feed straight from the single defaultFeedID argument passed into getSuggestedSearches:
The two operands of that ?? are not peers, and that is the bug:
defaultCardFeed comes from getDefaultCardFeed, whose candidate pool is cardFeedsByPolicy — built by getCardFeedsForDisplayPerPolicy, which iterates getOriginalCompanyFeeds only. Expensify Card feeds are never in that pool; it is company card feeds exclusively.
getDefaultCardFeed prioritizes the active workspace, but when the active workspace has no company feed it does not stop — it falls through to the first other eligible workspace that has one, and finally to any commercial feed on the account:
So defaultCardFeed is truthy as soon as any eligible workspace anywhere on the account has a company card feed, even one belonging to a workspace the user is not currently in. Because ?? only evaluates its right side when the left is nullish, defaultExpensifyCard is consulted only in the case where the account has no company card feed at all.
The result matches the report exactly: the tester's account has another workspace carrying a Regions Bank feed, so that foreign company feed wins the default, and the Expensify Card feed of the active workspace — the only card feed it actually has — can never be selected. The identical wiring also feeds the Statements tab, which resolves its feed from the same defaultFeedID.
What changes do you think we should make in order to solve the problem?
Make the active workspace's own feeds win over other workspaces' feeds, instead of letting the Expensify Card feed be a global last-resort fallback.
The Expensify Card feed should be a peer candidate inside the "prioritize the active policy" step of getDefaultCardFeed, rather than being bolted on afterwards with ?? in useSearchTypeMenuSections. Concretely:
Pass the Expensify Card feed (the value currently read via defaultExpensifyCardSelector) into the default-feed resolution alongside the company feeds, so the selection logic can see it.
In the active-policy branch, include that Expensify Card feed in the active workspace's candidate list when it belongs to that workspace — the feed carries a fundID, and a workspace is matched by its policyAccountID equalling that fundID, which is the same fund-to-workspace linkage getCardFeedsForDisplayPerPolicy already relies on for orphan feeds. Sort the combined list the same way the branch sorts today and return the first entry, so behaviour is unchanged for a workspace that has company feeds only.
One detail matters for the reported case: that branch is entered today only when the active workspace is in the eligible-policies list, and that list is built from areCompanyCardsEnabled — a company-card gate:
A workspace with Expensify Cards but no company cards enabled fails that gate, which is exactly the reported precondition, so the Expensify Card candidate has to be considered for the active workspace independently of it. The company feeds stay behind the gate exactly as today — it is only the Expensify Card feed, which that gate was never meant to govern, that is evaluated regardless.
Leave the remaining fallbacks in their current order — other eligible workspaces, then commercial feeds — and keep the Expensify Card feed as the final fallback for accounts with no company feed anywhere, which preserves today's behaviour for those accounts.
With this, the reported precondition (active workspace has Expensify Card and no company feed, another workspace has Regions Bank) resolves the default to the Expensify Card feed, so Card accruals opens with feed:Expensify Card. The Statements tab benefits from the same correction, since it reads the same default.
Because the default is consumed as a plain defaultFeedID, the fix stays confined to how that ID is chosen and needs no change to the suggested-search declarations themselves.
Resolving this inside useCardFeedsForDisplay rather than at the ?? in useSearchTypeMenuSections also removes an existing divergence between the two consumers of the default: SearchQueryProvider builds the suggested searches from a bare defaultCardFeed, with no Expensify Card fallback of its own, so today the two can disagree about which feed the tab is for. Having a single resolved default keeps the menu and the suggested searches in agreement.
What alternative solutions did you explore? (Optional)
I considered flipping the operands to defaultExpensifyCard ?? defaultCardFeed. That fixes this repro but overcorrects in the mirror case: a workspace whose only feed is a company feed would start defaulting to an Expensify Card feed owned by a different workspace. The problem is not which of the two wins globally — it is that workspace ownership is ignored entirely — so the precedence has to be decided per workspace, not by reordering a global ??.
I also considered including Expensify Card feeds directly in getCardFeedsForDisplayPerPolicy so they enter cardFeedsByPolicy naturally. That is arguably the tidier long-term shape, but cardFeedsByPolicy is consumed well beyond this default-feed path — the feed filter lists and the suggested-search visibility checks read it too — so widening it risks behaviour changes far outside the reported bug. Scoping the change to the default-feed resolution keeps the blast radius on the tab that is actually wrong.
[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.
Contributor+: @Eskalifer1 paid $250 via Upwork
Contributor+: @Krishna2323 due $250 via NewDot
@Eskalifer1 can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal. https://www.upwork.com/jobs/~022077825703650533825
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
ijmalik commentedon Jul 16, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Spends (Reports) page, clicking the "Card accruals" suggested search auto-fills the query with the account's company card feed (e.g.
feed:Region Bank) instead of the workspace's Expensify Card feed, even though the workspace has the Expensify Card set up with assigned cards.What is the root cause of that problem?
In
src/hooks/useSearchTypeMenuSections.ts(line 111, against origin/main), the feed passed tocreateTypeMenuSectionsisdefaultCardFeed: defaultCardFeed ?? defaultExpensifyCard, wheredefaultCardFeedcomes fromuseCardFeedsForDisplay()which only aggregates company card feeds fromSHARED_NVP_PRIVATE_DOMAIN_MEMBER— Expensify Card feeds are never part of that list (they are derived separately viadefaultExpensifyCardSelectorinsrc/selectors/Card.ts:78). Because of the nullish coalescing, whenever the account has any company card feed (Region Bank here), it always wins and the Expensify Card feed is only ever used when there are zero company feeds. That feed ID then flows intogetSuggestedSearches→ theUNAPPROVED_CARDitem'sfeed: [defaultFeedID](src/libs/SearchUIUtils.ts:914), producingfeed:Region Bankin the query.What changes do you think we should make in order to solve the problem?
In
src/hooks/useSearchTypeMenuSections.ts:111, swap the precedence so the workspace's Expensify Card feed is preferred when one exists:The same fallback should also be applied in
src/components/Search/SearchQueryProvider.tsx:44-47, which currently callsgetSuggestedSearches(accountID, defaultCardFeedID)using onlyuseCardFeedsForDisplay()'s company feed with no Expensify Card fallback at all — leaving it inconsistent would make the suggested-search hashes computed there (used for matching/highlighting the active suggested search) disagree with the menu items built inuseSearchTypeMenuSections, so "Card accruals" would stop being recognized as the active tab. No API/backend change is involved — thefeed:filter already accepts Expensify Card feed IDs (the same IDs built bygetExpensifyCardFeedsForDisplayinsrc/libs/CardFeedUtils.ts:152are already selectable in the search feed filter).What alternative solutions did you explore? (Optional)
Merging Expensify Card feeds into
cardFeedsByPolicyinsideuseCardFeedsForDisplay/getDefaultCardFeedso alphabetical/policy-priority sorting picks them naturally — rejected because that hook feeds other company-card-only UI and the refactor is much larger than needed for this bug.MelvinBot commentedon Jul 16, 2026
Proposal
What is the root cause of that problem?
The Card accruals item under Spends is the
UNAPPROVED_CARDsuggested search. Its query hard-codes a singlefeed:value, and that value is picked from the wrong source, so it lands on a company-card feed (e.g. Region Bank) instead of the Expensify Card.The feed passed into the suggested search is
defaultCardFeed ?? defaultExpensifyCardatsrc/hooks/useSearchTypeMenuSections.ts:111. The problem is thatdefaultCardFeednever contains the Expensify Card — by design,getCardFeedsForDisplayPerPolicyexcludes Expensify Card feeds (src/libs/CardFeedUtils.ts:227). So as soon as the workspace has any company-card feed,defaultCardFeedis truthy, the??short-circuits, anddefaultExpensifyCardis never used. The Expensify Card can only be selected when there are zero company feeds.That is why the tester — who has both an Expensify Card and a Region Bank company feed — gets
feed:Region Bankrather thanfeed:Expensify Card.Evidence / code path
UNAPPROVED_CARDsearch query is built withfeed: defaultFeedID ? [defaultFeedID] : ['']—src/libs/SearchUIUtils.ts:907-917, wheredefaultFeedID = defaultCardFeed?.id(passed atSearchUIUtils.ts:4605).defaultCardFeedgiven tocreateTypeMenuSectionsisdefaultCardFeed ?? defaultExpensifyCard—useSearchTypeMenuSections.ts:111.getDefaultCardFeedreturns the alphabetically-first company feed and only falls through to commercial feeds — it has no notion of the Expensify Card —useCardFeedsForDisplay.ts:26-56.getCardFeedsForDisplayPerPolicyexplicitly notes "Expensify Card feeds are not included (handled by the Expensify card selector)" —CardFeedUtils.ts:227.So the
??fallback is effectively backwards: it prefers the (non-Expensify) company feed and treats the Expensify Card as the last resort.What changes do you think we should make in order to solve the problem?
For the Card accruals (
UNAPPROVED_CARD) default feed, prefer the Expensify Card when the workspace has Expensify Cards enabled — i.e. flip the fallback order sodefaultExpensifyCardwins overdefaultCardFeedatuseSearchTypeMenuSections.ts:111, or pass a dedicated default feed for the accruals search rather than reusing the general company-card default.defaultCardFeed ?? defaultExpensifyCardordering looks intentional (Expensify Card as fallback), so please confirm the intended default is Expensify Card when both exist — the fix is a one-line reorder either way, but the expected behavior should be nailed down first.What alternative solutions did you explore? (Optional)
Leave the feed unset (
feed: ['']) so Card accruals shows all card feeds and the user picks — but that changes the current single-feed UX and likely isn't what's wanted.Possibly related (not duplicates)
Expensify/App#91790— [Exploratory] Spend-Card accruals highlight disappears after changing filters — same Card accruals area but about highlight/selection state, not the feed default.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/96342)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
David-2002065 commentedon Jul 16, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Spends page, opening the Card accruals suggested search builds a query whose
feed:filter auto-selects a company/bank card feed (e.g.feed:Region Bank) instead of the workspace's Expensify Card feed. On a workspace that runs the Expensify Card, the expected query isfeed:Expensify Card.What is the root cause of that problem?
The Card accruals (
UNAPPROVED_CARD) search takes its feed from a single pre-merged value built here:App/src/hooks/useSearchTypeMenuSections.ts
Lines 107 to 111 in d769fd5
The value passed as
defaultCardFeedisdefaultCardFeed ?? defaultExpensifyCard. Because a company feed (Region Bank) is truthy whenever it exists, the??short-circuits and the Expensify Card is only ever used on workspaces that have zero company feeds. That merged id flows throughcreateTypeMenuSections→getSuggestedSearchesand becomes thefeed:of Card accruals:App/src/libs/SearchUIUtils.ts
Lines 907 to 917 in d769fd5
So far this matches what others noticed. But the important part — and why simply flipping the
??is wrong — is that the two operands are resolved with different scoping:defaultCardFeedis active-policy-scoped.getDefaultCardFeedprioritizes the active policy's feeds, and only falls through to other eligible/commercial feeds:App/src/hooks/useCardFeedsForDisplay.ts
Lines 26 to 56 in d769fd5
defaultExpensifyCardis global. Its selector picks the first non-travel Expensify Card feed across the entireNON_PERSONAL_AND_WORKSPACE_CARD_LIST— every workspace the user belongs to, with no active-policy notion:App/src/selectors/Card.ts
Lines 78 to 81 in d769fd5
That mismatch is the real root cause. A blanket
defaultExpensifyCard ?? defaultCardFeedflip would fix the reported case but silently regress a mixed setup: a user whose active workspace uses company cards, but who also belongs to another workspace with an Expensify Card, would get that other workspace's Expensify Card injected into Card accruals. The feed must be resolved for the relevant policy, not merely preferred by truthiness.What changes do you think we should make in order to solve the problem?
Stop pre-merging in the hook, and resolve a dedicated Card-accruals feed that prefers the Expensify Card only when the active policy actually runs the Expensify Card program, falling back to the company feed otherwise.
In
useSearchTypeMenuSections, compute the accruals feed explicitly instead of the??merge:Pass
defaultCardFeedunchanged (drop the?? defaultExpensifyCard) and threadunapprovedCardFeedIDthrough togetSuggestedSearches, which uses it for theUNAPPROVED_CARDitem only:STATEMENTSstays ondefaultFeedID(the company feed), so its behaviour is unchanged. The sameunapprovedCardFeedIDmust also be computed and passed inSearchQueryProvider, which builds the suggested searches a second time — otherwise itssimilarSearchHashwon't match the menu item and the Card accruals tile won't highlight as active:App/src/components/Search/SearchQueryProvider.tsx
Lines 44 to 47 in d769fd5
To keep the two call sites from drifting, the resolution can live in one small helper next to
getDefaultCardFeedand be called from both.What specific scenarios should we cover in automated tests to prevent this from happening again?
Unit-test the
UNAPPROVED_CARDquery fromgetSuggestedSearches:feedis the Expensify Card feed id (the issue's expected result).feedis the company feed id.feedis the active workspace's company feed, not the other workspace's Expensify Card (guards the scoping regression the naive??flip introduces).feedis[''].What alternative solutions did you explore? (Optional)
Flipping the merge to
defaultExpensifyCard ?? defaultCardFeedatuseSearchTypeMenuSections.ts:111. Rejected: it fixes the single-workspace case but regresses the multi-workspace case above, becausedefaultExpensifyCardis global whiledefaultCardFeedis active-policy-scoped. Including Expensify Card feeds insidegetCardFeedsForDisplayPerPolicysogetDefaultCardFeedreturns one was also rejected — that exclusion is intentional and shared by the company-cards admin selectors, so it has a wide blast radius for a one-search bug.yusufdeveloper2903 commentedon Jul 16, 2026
Proposal
What is the root cause of that problem?
When building the
feed:xxxxsearch query for Card Accruals, the code that selects which card feed to use likely picks the first feed from the list of available card feeds without prioritizing the Expensify Card feed over regular bank account feeds. This means if a bank/region feed appears before the Expensify Card feed in the data structure, it gets selected instead.The relevant logic is likely in
src/libs/SearchQueryUtils.ts(or a similar query-building utility) where card feeds are resolved to a feed identifier.What changes do you think we should make in order to solve the problem?
When selecting the default card feed for the
feed:xxxxquery, we should prioritize feeds whose key/type indicates an Expensify Card (e.g., feed key starts withExpensifyor matchesCONST.EXPENSIFY_CARD.BANK/CONST.EXPENSIFY_CARD_BANK_NAME) over other bank feeds.This ensures the Expensify Card feed is preferred when constructing the search query, falling back to the first available feed only if no Expensify Card feed exists.
What alternative solutions did you explore?
I considered sorting feeds so Expensify Card always comes first universally, but that could have unintended side effects in other places that rely on feed ordering. A targeted fix at query-construction time is safer and more explicit.
aswin-s commentedon Jul 16, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Web, when a workspace has both an Expensify Card feed (with at least one card assigned to a user) and a commercial/bank card feed (e.g. Region Bank), navigating to Spends → Card accruals populates the search with
feed:<bank-feed-id>(Region Bank) instead offeed:Expensify Card. Expected: the Card accruals suggested search should default the feed to the workspace's Expensify Card feed when the user has assigned Expensify cards.What is the root cause of that problem?
The
feed:value for the "Card accruals" (UNAPPROVED_CARD) suggested search is built in src/libs/SearchUIUtils.ts:914 asfeed: defaultFeedID ? [defaultFeedID] : [''], wheredefaultFeedIDisdefaultCardFeed?.idfromuseCardFeedsForDisplay(src/components/Search/SearchQueryProvider.tsx:47 and src/libs/SearchUIUtils.ts:4605). The producer of that id,getDefaultCardFeedin src/hooks/useCardFeedsForDisplay.ts:26-56, picks the first feed of the active/eligible policy strictly bylocaleCompare(name)(lines 38, 46, 55) and never prefers an Expensify Card feed over a commercial bank feed — even thoughdefaultExpensifyCardis already computed separately and passed alongside (SearchUIUtils.ts:4605, gating card-accrual visibility at line 1116). So when the active policy has both an Expensify Card feed and a bank feed, whichever sorts first by name wins, which is why "Region Bank" is auto-selected instead of "Expensify Card".What changes do you think we should make in order to solve the problem?
src/hooks/useCardFeedsForDisplay.ts(getDefaultCardFeed, lines 26–56), when iterating the active policy's feeds (lines 35–40) and the eligible-policy fallback (lines 43–48), prefer an Expensify Card feed (detectable via the existingCardUtilshelpers used for Expensify feed types) over commercial/bank feeds before falling back to the alphabeticallocaleComparetiebreak.defaultExpensifyCardexists for the current context, passdefaultExpensifyCard.id(notdefaultCardFeed?.id) as thedefaultFeedIDtogetSuggestedSearchesfor theUNAPPROVED_CARDkey, so the Card accruals suggestion always seeds with the Expensify Card feed when one is available.getSuggestedSearchesin[src/libs/SearchUIUtils.ts:722](https://github.com/Expensify/App/blob/d769fd57fb65190d73383950d7120d6f6189717e/src/libs/SearchUIUtils.ts#L722)–930to accept a distinctdefaultExpensifyCardFeedID(or reusedefaultExpensifyCard) and use it at line 914 for theUNAPPROVED_CARDentry, keepingdefaultFeedIDfor the statements entry at line 866 unchanged.getDefaultCardFeed/getSuggestedSearches[UNAPPROVED_CARD].searchQuerycovering the "policy has both Expensify Card feed and bank feed" case, asserting the resulting query contains the Expensify Card feed id.What alternative solutions did you explore? (Optional)
abbasifaizan70 commentedon Jul 16, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-20 13:34:52 UTC.
Proposal (updated)
Please re-state the problem that we are trying to solve in this issue.
On a workspace that has both a company/bank card feed and the Expensify Card set up, clicking Card accruals from Spends opens a search with the company feed pre-selected (
feed:Region Bank) instead offeed:Expensify Card.Per @joekaufmanexpensify, the confirmed expected behavior is: Card accruals should default to the active workspace's Expensify Card whenever it is available, even when other third-party feeds exist — consistent with the Classic domains page and NewDot bank reconciliation, which both default to the Expensify Card when present.
What is the root cause of that problem?
The Card accruals (
UNAPPROVED_CARD) search fills itsfeed:filter from a singledefaultFeedID:That id comes from
defaultCardFeed ?? defaultExpensifyCardinuseSearchTypeMenuSections.ts:111. The two operands are not peers:defaultCardFeedis drawn fromcardFeedsByPolicy, which by design excludes Expensify Card feeds (getCardFeedsForDisplayPerPolicy, CardFeedUtils.ts — "Expensify Card feeds are not included"). SodefaultCardFeedcan only ever be a company feed, and the??reachesdefaultExpensifyCardonly when there is no company feed at all. As soon as any company feed exists, it wins — which is the reported bug.What changes do you think we should make in order to solve the problem?
Resolve a dedicated feed id for Card accruals that prefers the active workspace's Expensify Card, and thread it through both places that build the suggested searches so they stay in sync.
Resolve the active workspace's Expensify Card feed id.
defaultExpensifyCardSelector(Card.ts:78) is global, so don't use it directly. Pick the Expensify Card feed whosefundIDmaps to the active policy (the samefundID ↔ policyAccountIDlinkagegetCardFeedsForDisplayPerPolicyalready uses for orphan feeds). Call itactiveExpensifyCardFeedID.Prefer it only for
UNAPPROVED_CARD. Add a dedicated parameter togetSuggestedSearchesand use it for the Card accruals feed, leavingdefaultFeedID(the company feed) for the Statements entry unchanged:Update both call sites so their hashes agree. Pass
activeExpensifyCardFeedIDfrom the menu builder (SearchUIUtils.ts:4605) and fromSearchQueryProvider.tsx:47, which today passes only the company feed id. Without the second update, the menu item's feed and the provider's computedsimilarSearchHashdisagree, so the Card accruals tab won't highlight as active.No API/backend change — the
feed:filter already accepts Expensify Card feed ids.What specific scenarios should we cover in automated tests to prevent this from happening again?
[''].similarSearchHashfromSearchQueryProvidermatches the menu item).What alternative solutions did you explore? (Optional)
defaultExpensifyCard ?? defaultCardFeed. Rejected: fixes the repro but regresses mixed multi-workspace setups, becausedefaultExpensifyCardis global whiledefaultCardFeedis active-policy-scoped — a user in a company-card workspace who also belongs to an Expensify-Card workspace would get the wrong workspace's card.getCardFeedsForDisplayPerPolicy/ rewritegetDefaultCardFeed. Rejected: that exclusion is intentional and shared by company-card admin UI, so the blast radius is far wider than this one search.samranahm commentedon Jul 16, 2026
Proposal
What is the root cause of that problem?
When an admin opens Spends and taps the "Card accruals" row, NewDot builds a Search query whose
feed:filter is meant to point at the Expensify Card feed. Instead the query resolves to a commercial bank feed (Region Bank), so the header showsfeed:xxxxfor a bank account rather thanfeed:Expensify Card.The feed used to build the card menu items comes from
useSearchTypeMenuSections, which passesdefaultCardFeedintocreateTypeMenuSectionswith this fallback order:App/src/hooks/useSearchTypeMenuSections.ts
Lines 63 to 142 in d769fd5
Here
defaultCardFeedcomes fromuseCardFeedsForDisplay()anddefaultExpensifyCardcomes from theNON_PERSONAL_AND_WORKSPACE_CARD_LISTderived selector. Because the value passed isdefaultCardFeed ?? defaultExpensifyCard, any generic default card feed (which can be a commercial bank feed such as Region Bank) takes priority over the Expensify Card feed. So on a workspace that has both an assigned Expensify Card and a bank feed, the Expensify-Card-specific accruals item inherits the bank feed, which is whyfeed:auto-selects Region Bank instead of Expensify Card.What changes do you think we should make in order to solve the problem?
useSearchTypeMenuSections.ts, the Expensify Card accruals item must be built fromdefaultExpensifyCard, not from the genericdefaultCardFeed ?? defaultExpensifyCardvalue that prefers bank feeds.App/src/hooks/useSearchTypeMenuSections.ts
Lines 63 to 142 in d769fd5
Today
defaultExpensifyCardis already read from the derived card list selector, but it is only used as a fallback. Pass it through as its own argument socreateTypeMenuSectionscan build the Expensify Card accruals query from the Expensify Card feed specifically:createTypeMenuSections(insideSearchUIUtils.ts), when constructing the Expensify Card accruals menu item, use the newdefaultExpensifyCardargument to build itsfeed:filter instead of the shareddefaultCardFeed.https://github.com/Expensify/App/blob/d769fd57fb65190d73383950d7120d6f6189717e/src/libs/SearchUIUtils.ts
This keeps generic card sections using
defaultCardFeedwhile ensuring the accruals row that is meant for the Expensify Card always resolves to the Expensify Card feed, which fixes the wrongfeed:Region Bankselection.What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
melvin-bot commentedon Jul 16, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Eskalifer1 (
External)wildan-m commentedon Jul 16, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-16 18:49:34 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On a workspace that has the Expensify Card feature enabled and at least one card assigned, opening Spends → Card accruals builds a search query that auto-selects a company card feed (e.g.
feed:Regions Bank) instead offeed:Expensify Card.What is the root cause of that problem?
The Card accruals suggested search takes its feed straight from the single
defaultFeedIDargument passed intogetSuggestedSearches:App/src/libs/SearchUIUtils.ts
Lines 907 to 918 in d769fd5
That argument is
defaultCardFeed?.id, anddefaultCardFeedis resolved one level up asdefaultCardFeed ?? defaultExpensifyCard:App/src/hooks/useSearchTypeMenuSections.ts
Line 111 in d769fd5
The two operands of that
??are not peers, and that is the bug:defaultCardFeedcomes fromgetDefaultCardFeed, whose candidate pool iscardFeedsByPolicy— built bygetCardFeedsForDisplayPerPolicy, which iteratesgetOriginalCompanyFeedsonly. Expensify Card feeds are never in that pool; it is company card feeds exclusively.getDefaultCardFeedprioritizes the active workspace, but when the active workspace has no company feed it does not stop — it falls through to the first other eligible workspace that has one, and finally to any commercial feed on the account:App/src/hooks/useCardFeedsForDisplay.ts
Lines 26 to 56 in d769fd5
So
defaultCardFeedis truthy as soon as any eligible workspace anywhere on the account has a company card feed, even one belonging to a workspace the user is not currently in. Because??only evaluates its right side when the left is nullish,defaultExpensifyCardis consulted only in the case where the account has no company card feed at all.The result matches the report exactly: the tester's account has another workspace carrying a Regions Bank feed, so that foreign company feed wins the default, and the Expensify Card feed of the active workspace — the only card feed it actually has — can never be selected. The identical wiring also feeds the Statements tab, which resolves its feed from the same
defaultFeedID.What changes do you think we should make in order to solve the problem?
Make the active workspace's own feeds win over other workspaces' feeds, instead of letting the Expensify Card feed be a global last-resort fallback.
The Expensify Card feed should be a peer candidate inside the "prioritize the active policy" step of
getDefaultCardFeed, rather than being bolted on afterwards with??inuseSearchTypeMenuSections. Concretely:Pass the Expensify Card feed (the value currently read via
defaultExpensifyCardSelector) into the default-feed resolution alongside the company feeds, so the selection logic can see it.In the active-policy branch, include that Expensify Card feed in the active workspace's candidate list when it belongs to that workspace — the feed carries a
fundID, and a workspace is matched by itspolicyAccountIDequalling thatfundID, which is the same fund-to-workspace linkagegetCardFeedsForDisplayPerPolicyalready relies on for orphan feeds. Sort the combined list the same way the branch sorts today and return the first entry, so behaviour is unchanged for a workspace that has company feeds only.One detail matters for the reported case: that branch is entered today only when the active workspace is in the eligible-policies list, and that list is built from
areCompanyCardsEnabled— a company-card gate:App/src/hooks/useCardFeedsForDisplay.ts
Lines 17 to 24 in d769fd5
A workspace with Expensify Cards but no company cards enabled fails that gate, which is exactly the reported precondition, so the Expensify Card candidate has to be considered for the active workspace independently of it. The company feeds stay behind the gate exactly as today — it is only the Expensify Card feed, which that gate was never meant to govern, that is evaluated regardless.
Leave the remaining fallbacks in their current order — other eligible workspaces, then commercial feeds — and keep the Expensify Card feed as the final fallback for accounts with no company feed anywhere, which preserves today's behaviour for those accounts.
With this, the reported precondition (active workspace has Expensify Card and no company feed, another workspace has Regions Bank) resolves the default to the Expensify Card feed, so Card accruals opens with
feed:Expensify Card. The Statements tab benefits from the same correction, since it reads the same default.Because the default is consumed as a plain
defaultFeedID, the fix stays confined to how that ID is chosen and needs no change to the suggested-search declarations themselves.Resolving this inside
useCardFeedsForDisplayrather than at the??inuseSearchTypeMenuSectionsalso removes an existing divergence between the two consumers of the default:SearchQueryProviderbuilds the suggested searches from a baredefaultCardFeed, with no Expensify Card fallback of its own, so today the two can disagree about which feed the tab is for. Having a single resolved default keeps the menu and the suggested searches in agreement.Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/96342-default-card-feed-active-workspace?expand=1
What alternative solutions did you explore? (Optional)
I considered flipping the operands to
defaultExpensifyCard ?? defaultCardFeed. That fixes this repro but overcorrects in the mirror case: a workspace whose only feed is a company feed would start defaulting to an Expensify Card feed owned by a different workspace. The problem is not which of the two wins globally — it is that workspace ownership is ignored entirely — so the precedence has to be decided per workspace, not by reordering a global??.I also considered including Expensify Card feeds directly in
getCardFeedsForDisplayPerPolicyso they entercardFeedsByPolicynaturally. That is arguably the tidier long-term shape, butcardFeedsByPolicyis consumed well beyond this default-feed path — the feed filter lists and the suggested-search visibility checks read it too — so widening it risks behaviour changes far outside the reported bug. Scoping the change to the default-feed resolution keeps the blast radius on the tab that is actually wrong.71 remaining items
melvin-bot commentedon Aug 9, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 9, 2026
Payment Summary
Resolving PRs:
Upwork Job
BugZero Checklist (@mallenexpensify)
Krishna2323 commentedon Aug 10, 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: Reports - Search query shows "feed:" when workspace has Expensify Card #71478 (review)
Link to the comment on the Issue: [Due for payment 2025-10-09] [$250] Reports - Search query shows "feed:" when workspace has Expensify Card #70743 (comment)
[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: https://github.com/Expensify/Expensify/issues/670808
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-c24d-a477-af73-02f017634134mallenexpensify commentedon Aug 12, 2026
Payment Summary
Contributor+: @Eskalifer1 paid $250 via Upwork
Contributor+: @Krishna2323 due $250 via NewDot
@Eskalifer1 can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022077825703650533825
Eskalifer1 commentedon Aug 12, 2026
Hi @mallenexpensify, i have accepted, thank you!
mallenexpensify commentedon Aug 12, 2026
@Eskalifer1 paid, summary updated above. Thx.
laurenreidexpensify commentedon Aug 26, 2026
$250 approved for @Krishna2323 New Expensify