Repository navigation
Keep individual card errors out of feed-wide connection warning - #106104
Conversation
Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
|
I created this draft from an upstream branch because I could not access a contributor fork for To take ownership of the branch and push updates from your fork: git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-cardSpecificConnectionWarning
git checkout -b claude-cardSpecificConnectionWarning upstream/claude-cardSpecificConnectionWarning
git push -u origin claude-cardSpecificConnectionWarningYou can then close this draft and open a replacement PR from your fork. |
| * the feed itself has errors. Individual card issues, such as status 434, must not label the | ||
| * entire feed as broken. |
There was a problem hiding this comment.
NAB: this states the rule but not why, or where a 434 card's issue is shown instead. #100277 added hasFeedConnectionIssue here because Wallet sends admins to this page with "Fix connection in Company cards", so without the reason someone could add it back. Could we say that the card's own row shows it?
| * the feed itself has errors. Individual card issues, such as status 434, must not label the | |
| * entire feed as broken. | |
| * the feed itself has errors. Statuses that `isFeedConnectionBroken` ignores, such as 434, affect | |
| * only the card that reports them while the rest of the feed keeps syncing, so they are shown on | |
| * that card's row instead of as a broken connection for the whole feed. |
|
🤖 Android test steps verification results: Inspected standalone Android NewDot, but required bank/card fixtures are unavailable: the account has no workspaces; no fixtures were invented. JS-console inspection was also blocked, so none of the test cases could be confirmed.
|
|
@MelvinBot Please add the test steps to the PR description. This state is hard to reach with a real account, so it's fine to test it with mock data. |
|
🤖 Web test steps verification results: Blocked on dev NewDot web: the account has no workspaces or card feeds. No supported browser fixture was found; no mock data was injected or state invented.
|
|
Added mock-data test instructions to the PR description: automated regression commands plus UI checks for mixed healthy/434 cards, card-specific errors, Wallet messaging, dismissal, and genuine feed failures. The steps are explicitly marked pending execution. Human Tests/QA confirmations remain untouched, and the description notes that UI checks require a local mock fixture/harness. |
Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
|
Pushed fd2873450 to fix the Oxfmt failure: one missing blank line between import groups in CardFeedErrorsDerivedValueTest.ts:2. No logic changed.
CI has restarted; the new Oxfmt check was still queued at the last check. |
|
|
|
@JS00001 I approved the wrong PR. This PR isn't ready yet. |
|
@MelvinBot Please add the test steps and QA steps. |
|
no worries, just ping me when its ready again please |
|
Added numbered steps directly under Tests and QA Steps in the PR description, including mock-data prerequisites and expected results for card-specific errors, Wallet status, dismissal, and genuine feed failures. Both procedures are marked pending execution; no testing confirmations were checked off. |
|
@MelvinBot the Tests and QA steps are hard to follow as one block of text. Please replace the Tests, Offline tests and QA Steps sections with the version below? Dev can't produce a real 434 card, so the steps use mock data. TestsSetup (once):
Mock data scriptconst 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});
// Stops the server from replacing the mock data
await Onyx.merge('network', {shouldForceOffline: true});
// cardFeedsStatus: null clears any "Couldn't load this feed" error left over from an earlier run
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}`);Run steps 2–5 in the same console session as the setup script, so Steps:
Offline testsThe banner is computed only from local data, and the setup script forces the app offline, so steps 1–4 above also cover offline behaviour. QA StepsSame as tests. Staging can't produce a 434 card either, so use the mock data script above.
|
|
Replaced Tests, Offline tests, and QA Steps in the PR description with your supplied version, including the mock script and console checkboxes. All other sections are unchanged. No tests were rerun. |
|
@MelvinBot Make PR ready for review |
|
Marked Keep individual card errors out of feed-wide connection warning as ready for review. |
|
@linhvovan29546 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppN/A. This change doesn't affect the UI. Android: mWeb ChromeN/A. This change doesn't affect the UI. iOS: HybridAppN/A. This change doesn't affect the UI. iOS: mWeb SafariN/A. This change doesn't affect the UI. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd2873450b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| function getShouldShowBrokenConnectionError(feedName: CompanyCardFeedWithDomainID, feedErrors: CardFeedErrorState | undefined): boolean { | ||
| const hasConnectionToFix = !!feedErrors?.isFeedConnectionBroken || !!feedErrors?.hasFeedConnectionIssue; | ||
| return (hasConnectionToFix && isDirectFeed(feedName)) || !!feedErrors?.hasFeedErrors; | ||
| return (!!feedErrors?.isFeedConnectionBroken && isDirectFeed(feedName)) || !!feedErrors?.hasFeedErrors; |
There was a problem hiding this comment.
Preserve a reconnect affordance for actionable card errors
When a direct-feed card reports an actionable ignored status such as 434, isFeedConnectionBroken is intentionally false while hasFeedConnectionIssue remains true, so this condition now hides the login link. PaymentMethodList still marks that card inactive and directs an admin to the Company Cards page, but the destination row only displays a dismissible error and does not start startCardFeedRefresh; after dismissal it displays no card-level indication at all. Add a card-specific reconnect action before removing hasFeedConnectionIssue from this gate, otherwise the Wallet's advertised fix flow leads to a page without the expected fix.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not a blocker IMO. This is the same concern Codex raised in #100277 (#100277 (comment)). Adding hasFeedConnectionIssue to the banner to address it is what caused #105932.
A 434 means that one card's account wasn't found (e.g. a cancelled card), so logging into the bank won't fix it. The admin still sees the error on the card's row and can use Update card or Unassign card from its details page.
|
🚧 joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Tested on customer account who was experiencing issue and confirmed it is resolved 👍
|
🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.36-0 🚀
|
|
No help site update needed — this bug fix only prevents an individual card issue from incorrectly triggering a feed-wide warning; it adds no workflow and makes no existing article sentence incorrect. |
|
No FullStory changes needed — this PR only fixes an incorrect feed-wide warning for individual card errors and adds regression tests, without introducing new screens, interactions, user properties, or sensitive content. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀
Bundle Size Analysis (Sentry): |







Explanation of Change
An individual card returning 434 must not label the entire company-card feed as broken. Limit the banner to broken direct-feed connections or explicit feed errors. Preserve existing card errors and Wallet inactive-card classification.
Regression coverage uses the real derived configuration with healthy and 434 cards from both card collections, in either order, before and after error dismissal. Additional cases preserve warnings for genuine failures and explicit errors across feed types.
AI Tests
npm run fmt; only one missing blank line between regression-test import groups changed. A second formatter run made no further changes.npm run lint-changed, targeted lint,npm run typecheck,npm run spell-changed, Storybook smoke test, staged coding-standards review, andgit diff --check.prettierscript remains unavailable; the actual CI formatter (npm run fmt) passed instead. No browser rerun was needed for the test-only whitespace change.Original implementation validation:
npm run lint,npm run lint-changed,npm run typecheck,npm run spell-changed, andnpm run storybook -- --smoke-test --ci.npm test -- --silent --maxWorkers=2timed out after 600 seconds. No failing suites appeared before timeout; this is not a full-suite pass.npm run prettier -- --log-level errorcommand is unavailable because this checkout has noprettierscript. Attempts to invoke the current formatter directly were denied.git diff --checkpassed.Fixed Issues
$ #105932
PROPOSAL: #105932 (comment)
Automated mock-data regression steps
These are repeatable instructions, not a claim that manual Tests/QA have passed. Mock data is sufficient; a live bank connection is not required for the automated regression checks.
npm test -- --runInBand CardFeedErrorsDerivedValueTest getShouldShowBrokenConnectionErrorTestTests
Setup (once):
…1111) and a 434 card (…4340).Mock data script
Run steps 2–5 in the same console session as the setup script, so
cardsKeyandcardare still defined.Steps:
…4340shows its own row error: "There's an issue with this card's connection…".Onyx.merge(cardsKey, {2: {lastScrapeResult: 403}})to simulate a real feed failure. Verify the banner appears.Onyx.merge(cardsKey, {3: card(3, '5555', 434)})to add a second 434 card alongside the 403. Verify the banner still appears.Onyx.merge(cardsKey, {2: {lastScrapeResult: 200, errors: null}, 3: null})so all cards are healthy. Verify there's no banner and no row errors.Onyx.merge('network', {shouldForceOffline: false})to restore the network. The page then shows "Couldn't load this feed" because the feed is mock data. That's expected.Offline tests
The banner is computed only from local data, and the setup script forces the app offline, so steps 1–4 above also cover offline behaviour.
QA Steps
Same as tests. Staging can't produce a 434 card either, so use the mock data script above.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari