Skip to content

[Due for payment 2026-11-19] [$175] Regression: Individual card error incorrectly triggers feed-wide broken connection warning #105932

Open

Description

@melvin-bot

An individual card returning error 434 (“Account not found”) can trigger a feed-wide broken connection warning while other cards continue syncing.

Expected: Identify the affected card without labeling the entire feed as broken. Preserve feed-wide warnings for actual connection failures.

Reported regression: #84803 excluded 434 from feed-level warnings. #100277 reintroduced this behavior while improving inactive-card messaging.

Verification: Test a feed containing healthy cards and one card returning 434. Confirm that the warning identifies the affected card and that genuine feed-wide failures still display correctly.

Reported in slack

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added theissue type on Nov 4, 2026
  2. melvin-bot commented on Nov 4, 2026

    @melvin-bot
    Author

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @linhvovan29546 (External)

  3. changed the title [-]Regression: Individual card error incorrectly triggers feed-wide broken connection warning[/-] [+][$175] Regression: Individual card error incorrectly triggers feed-wide broken connection warning[/+] on Nov 4, 2026
  4. melvin-bot commented on Nov 4, 2026

    @melvin-bot
    Author
  5. joekaufmanexpensify commented on Nov 4, 2026

    @joekaufmanexpensify
    Contributor

    @MelvinBot please draft a proposal for this issue using Expensify's standard process.

  6. MelvinBot commented on Nov 4, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The feed banner treats an individual card issue as a broken feed connection. Error 434 remains excluded from isFeedConnectionBroken, but the banner also checks hasFeedConnectionIssue, which includes 434.

    Code evidence

    CardUtils.ts:1702–1726 distinguishes the two classifications. cardFeedErrors.ts:153–161 aggregates them separately. getShouldShowBrokenConnectionError.ts:14–16 combines them again, causing the false warning.

    What changes do you think we should make in order to solve the problem?

    • Show the banner for isFeedConnectionBroken on direct feeds, or explicit hasFeedErrors. Remove hasFeedConnectionIssue from this decision.
    • Preserve affected-card errors and Wallet inactive messaging. Leave the shared card-issue classifier unchanged.
    • Add regression coverage: healthy card plus 434 shows no feed banner but retains the affected card’s error. Genuine connection failures and explicit feed errors must still show the applicable warning.
    Tests and scope

    Update the existing test expecting the incorrect banner. Cover dismissed card errors and preserve direct/commercial-feed behavior. Card-row errors already render separately in WorkspaceCompanyCardsTable/index.tsx:281–328.

    Code review only; no tests executed.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/105932) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

  7. Aschio12 commented on Nov 4, 2026

    @Aschio12

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    On a direct (OAuth/Plaid) company card feed, when one card returns scrape status 434 ("Account not found"), the Company Cards page shows the red banner "Card feed connection is broken. Please log into your bank…" even though the other cards keep syncing. The banner says the whole feed is broken, and it doesn't point at the affected card. Real feed-wide failures must keep their banner.

    What is the root cause of that problem?

    One yes/no check mixes two different situations, and the banner has only one message for both.

    1. One boolean for two signals. getShouldShowBrokenConnectionError computes isFeedConnectionBroken || hasFeedConnectionIssue. The first means the feed's connection is really broken. The second is true when any single card has an "actionable" status, and 434 is the only status in that list (actionableIgnoredScrapeStatuses in CONST).
    2. One message for both. WorkspaceCompanyCardsTableHeaderButtons.tsx always shows workspace.companyCards.brokenConnectionError ("Card feed connection is broken…") when that boolean is true. So a single 434 card labels the whole feed as broken.
    3. The 434 case was added on purpose. hasCardConnectionIssue adds 434 to the broken check so a 434 card doesn't read as "Active", and Wallet sends an admin to this page with "Fix connection in Company cards" (getCardConnectionStatusDisplay, shouldUseCompanyCardsLink). The existing test at lines 50-62 says "the page has to offer the fix". The banner's "log into your bank" link is the only place on this page that offers it.

    So the regression is the wrong message and scope, not the fact that 434 shows something. Removing 434 from the banner entirely would leave an admin who followed Wallet's link with nothing to do.

    What changes do you think we should make in order to solve the problem?

    Keep the fix, but stop calling it a feed failure:

    1. In getShouldShowBrokenConnectionError.ts, return which kind of message to show, not just true or false. For example getBrokenConnectionErrorType(feedName, feedErrors):
      • 'feed' when the feed has errors, or a direct feed has isFeedConnectionBroken. This is today's behavior.
      • 'card' when a direct feed has only hasFeedConnectionIssue (for example 434).
      • undefined otherwise, including commercial and CSV feeds, same as today.
    2. In WorkspaceCompanyCardsTableHeaderButtons.tsx, keep the current message for 'feed'. For 'card', show a card-scoped message with the same "log into your bank" link and the same openBankConnection action. Suggested wording: "One or more cards need attention. Please log into your bank so we can update them." The exact copy is open to the reviewer. Add the new string to en.ts and the other language files, following the repo's translation process.
    3. The affected card is identified in its own row. The table already shows a card's own error on its row whenever the feed isn't prompting a broken connection, which is the case for 434. So the user sees which card, and the banner no longer says the feed is broken.

    Nothing changes in hasCardConnectionIssue, isCardConnectionBroken, the derived cardFeedErrors value, Wallet, or personal cards.

    What alternative solutions did you explore? (Optional)

    • Remove hasFeedConnectionIssue from the banner decision. This is the simplest change, and it stops the false "feed is broken" message. But it removes the only reconnect link for a 434 card, even though Wallet sends admins to this page to use it. It also means deleting a test that records intended behavior, so I'd rather not undo that choice silently.
    • Name the card inside the banner. This needs per-card data added to the derived cardFeedErrors value and its type. That is a heavier change, and the row error already identifies the card. It could follow up if reviewers want it.
    • Change which statuses count as an issue (hasCardConnectionIssue). This would bring back the "Active" label on a card that needs action.

    Automated Tests

    • Unit tests in tests/unit/components/Tables/WorkspaceCompanyCardsTable/getShouldShowBrokenConnectionErrorTest.ts, updating the 434 cases:
      • A direct feed with only hasFeedConnectionIssue returns 'card', not 'feed'.
      • A broken direct feed returns 'feed', and so does a feed with one broken card and one 434 card.
      • A feed with hasFeedErrors returns 'feed' on any feed type.
      • A commercial or CSV feed with only 434 returns undefined, and no errors returns undefined.
    • UI test in tests/ui/WorkspaceCompanyCardsTableHeaderButtonsTest.tsx:
      • A feed with only a 434 card shows the card-scoped message and not "Card feed connection is broken", and its link still opens the bank connection.
      • A feed with isFeedConnectionBroken still shows the original message.

    I did not run this against a real 434 card, because that needs a live bank feed. The analysis is from reading the code at commit 3c98f25.

    Contributor details
    Expensify account email: aschalewdere2@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~01b64b281fe1263953

  8. melvin-bot commented on Nov 4, 2026

    @melvin-bot
    Author

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  9. camesenin commented on Nov 4, 2026

    @camesenin
  10. melvin-bot commented on Nov 4, 2026

    @melvin-bot
    Author

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  11. khizzcr7 commented on Nov 4, 2026

    @khizzcr7

    Problem: On a direct (OAuth/Plaid) company card feed, one card returning scrape status 434 ("Account not found") makes the Company Cards page show the feed-wide red banner "Card feed connection is broken. Please log into your bank…", even though the other cards keep syncing. The issue asks for the affected card to be identified without labelling the whole feed as broken, and for genuine feed-wide failures to keep their warning.

    Root cause: Two different signals are collapsed into one boolean in getShouldShowBrokenConnectionError.ts (isFeedConnectionBroken || hasFeedConnectionIssue). The first means the feed connection itself is broken; the second is true when any single card has an actionable status, and 434 is the only status in that list (ACTIONABLE_IGNORED_SCRAPE_STATUSES in CONST). PR #100277 wired that per-card signal into the feed-level derived state (cardFeedErrors.ts sets hasFeedConnectionIssue from hasCardConnectionIssue(card)), so a single 434 card flips the feed-wide banner. The 434 exclusion from #84803 still holds at the card level (isCardConnectionBroken returns false for 434), which is why the card row itself renders its own error correctly while the banner mislabels the feed.

    Fix: Keep the two signals separate all the way to the banner, and make the card case name the card — this is the part the existing proposals leave out (Aschio12's proposal defers naming the card as a follow-up; the others drop the card case from the banner entirely, which also drops the only reconnect link Wallet sends admins here to use):

    1. In cardFeedErrors.ts, carry the affected cards alongside the flag: when aggregating a feed's errors, collect the cards whose hasCardConnectionIssue is true (their card names / last-4 identifiers) into the derived CardFeedErrorState, instead of reducing them to a bare boolean.
    2. In getShouldShowBrokenConnectionError.ts, return a result type, not a boolean: 'feed' when the feed has errors or a direct feed has isFeedConnectionBroken (today's behaviour, unchanged message), 'card' with the affected-card list when a direct feed has only hasFeedConnectionIssue (e.g. only 434 cards), and undefined otherwise (including commercial and CSV feeds, same as today).
    3. In WorkspaceCompanyCardsTableHeaderButtons.tsx, keep the current "Card feed connection is broken…" message for 'feed'. For 'card', render a card-scoped banner naming the affected card(s) — e.g. "Card ending in XXXX needs attention. Please log into your bank so we can update it." — with the same openBankConnection link, so an admin arriving from Wallet's "Fix connection in Company cards" link still has exactly one thing to do, and the banner itself identifies the card instead of relying only on the row error below it.
    4. Change nothing in hasCardConnectionIssue, isCardConnectionBroken, the Wallet inactive-card messaging, or personal cards, so a 434 card still reads as needing action (not "Active") everywhere else.

    Verification: Feed with healthy cards plus one 434 card shows the named-card banner, not the feed-broken message, and the card row still shows its own error; a feed with a genuine connection failure still shows the original feed-broken banner; a feed with one broken card plus one 434 card still shows the feed banner. Update getShouldShowBrokenConnectionErrorTest.ts (434-only returns 'card' with the card list; broken-feed cases return 'feed'; commercial/CSV 434-only returns undefined) and add a header-buttons UI test for the named-card banner and its bank link. I could not reproduce against a live 434 bank card (needs a live bank feed); the analysis is from the code at commit 3c98f25 and the existing proposals on this issue.

  12. 19 remaining items

  13. changed the title [-][$175] Regression: Individual card error incorrectly triggers feed-wide broken connection warning[/-] [+][Due for payment 2026-11-19] [$175] Regression: Individual card error incorrectly triggers feed-wide broken connection warning[/+] on Nov 12, 2026
  14. melvin-bot commented on Nov 12, 2026

    @melvin-bot
    Author

    @linhvovan29546

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.36-0 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-19. 🎊

    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]

  15. linhvovan29546 commented on Nov 12, 2026

    @linhvovan29546
    Contributor

    BugZero Checklist

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/100277/changes#r4551359341

    • [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

    A 434 card cannot be produced, so the steps use the mock data script from the PR.

    1. Create a workspace, enable Company cards in More features, and open Workspaces > the workspace > Company cards.

    2. In the browser console, run the script below. It adds a direct Chase feed with a healthy card (…1111) and a 434 card (…4340):

      const policyID = location.pathname.split('/')[2];
      const wsID = (await Onyx.get(`policy_${policyID}`)).policyAccountID;
      const {accountID} = await Onyx.get('session');
      const feed = 'oauth.chase.com';
      const cardsKey = `cards_${wsID}_${feed}`;
      const card = (id, last4, status, errors) => ({cardID: id, bank: feed, fundID: String(wsID), accountID, state: 3, cardName: `CARD...${last4}`, encryptedCardNumber: `CARD...${last4}`, lastFourPAN: last4, lastScrapeResult: status, errors});
      
      await Onyx.merge('network', {shouldForceOffline: true});
      await Onyx.merge(`sharedNVP_private_domain_member_${wsID}`, {settings: {companyCards: {[feed]: {pending: false}}, oAuthAccountDetails: {[feed]: {accountList: ['CARD...1111', 'CARD...4340']}}, cardFeedsStatus: null}});
      await Onyx.set(cardsKey, {1: card(1, '1111', 200), 2: card(2, '4340', 434, {connectionError: "There's an issue with this card's connection, which may result in you not seeing transactions. Log into your bank on your company cards page to restore card imports."})});
      await Onyx.merge(`lastSelectedFeed_${policyID}`, `${feed}#${wsID}`);
    3. Verify that there is no "Card feed connection is broken" banner.

    4. Verify that card …4340 shows its own row error: "There's an issue with this card's connection…".

    5. In the same console session, run Onyx.merge(cardsKey, {2: {lastScrapeResult: 403}}) to simulate a real feed failure.

    6. Verify that the "Card feed connection is broken" banner appears.

    7. Run Onyx.merge(cardsKey, {3: card(3, '5555', 434)}) to add a second 434 card alongside the 403 card.

    8. Verify that the banner still appears.

    9. Run Onyx.merge(cardsKey, {2: {lastScrapeResult: 200, errors: null}, 3: null}) so all cards are healthy.

    10. Verify that there is no banner and no row errors.

    11. Run Onyx.merge('network', {shouldForceOffline: false}) to restore the network. "Couldn't load this feed" is expected here because the feed is mock data.

    12. Verify that a feed with only a 434 card never shows the "Card feed connection is broken" banner (steps 3 and 4), which is where the bug showed it.

    Do we agree 👍 or 👎.

  16. expensify-chore-bot commented on Nov 18, 2026

    @expensify-chore-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  17. expensify-chore-bot commented on Nov 18, 2026

    @expensify-chore-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  18. mallenexpensify commented on Nov 20, 2026

    @mallenexpensify
    Contributor

    Claude posting on behalf of Matt:

    Ready. Job price: $175 (standard, no Help Wanted, assigned 2026-11-04).

    • linhvovan29546 (C+): 100%, via NewDot

    No deploy blockers or regressions on the issue or the PR.

    Next: press Caps+Y, then pay.

    Evidence
    • C+ checklist, 12 steps: comment.
    • PR 106104: by MelvinBot, merged 2026-11-10, production 2026-11-12, approved by linhvovan29546, JS00001 and joekaufmanexpensify. No revert.
    • Test videos: C+ 1/5.

    PAYPREP v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions