Fix Account and Wallet RBR still showing for personal cards past the 90-day grace period#96364
Draft
wildan-m wants to merge 1 commit into
Draft
Fix Account and Wallet RBR still showing for personal cards past the 90-day grace period#96364wildan-m wants to merge 1 commit into
wildan-m wants to merge 1 commit into
Conversation
…race period The 90-day grace correctly removed the home task, but the Account indicator and the Wallet row red dot stayed lit for personal cards. Both are driven by the card's own error, which the issue requires us to keep so the card stays fixable: - getShouldShowRBR short-circuits on hasFeedErrors before the grace check, so a past-grace card's error still forced the RBR. - hasPaymentMethodError counts any personal card with errors, and it feeds both the Account indicator (useAccountIndicatorChecks) and the Wallet row (InitialSettingsPage). Gate both on isBrokenConnectionPastDismissThreshold, leaving card.errors untouched so the Wallet-page card row keeps its error and Fix card action. Adds regression tests for a past-grace card that still carries the error (the case the original fixtures missed), plus guards that within-grace and unrelated errors still show.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Follow-up to #93523, which shipped the 90-day grace period for broken card connections. That change correctly removed the time-sensitive Home task, but for personal cards the
Accountindicator and theWalletrow red dot stayed lit — which the issue explicitly asks us to remove:Reported on production by @joekaufmanexpensify during the regression period: #91451 (comment)
Root cause. Both indicators are driven by the card's own error — which we intentionally keep so the card stays fixable — through two paths that never consult the grace period:
getShouldShowRBR()in thecardFeedErrorsderived value short-circuits onhasFeedErrors(built fromcard.errors/card.errorFields) before it ever reaches the gatedisFeedConnectionBroken.hasPaymentMethodError()returnstruefor any personal card witherrors. Its only two consumers are exactly the two affected surfaces —useAccountIndicatorChecks(theAccountindicator) andInitialSettingsPage(theWalletrow).So keeping the error (as the issue requires) kept the red dot lit forever. That the Home task was correctly removed is the tell: the grace check itself works, but these two paths bypass it.
Fix. Gate both paths on the existing
isBrokenConnectionPastDismissThreshold.card.errorsis left completely untouched, so the card's row on theWalletpage keeps its error and the Fix card action — only theAccount/Walletrow indicators stop.This only affects personal cards whose broken connection is past the grace period. Cards within the grace period, and cards with unrelated errors, are unchanged (both covered by new tests).
Fixed Issues
$ #91451
PROPOSAL: #91451 (comment)
Tests
This is shared logic (no platform-specific code), so it behaves the same on web, mWeb, iOS and Android.
Important — what actually reproduces this. It only shows up on a personal card (one added on
Account > Wallet, i.e.fundIDis absent or'0') whose broken connection also carries an error on the card itself. That error is what lights theAccount/Walletred dots, and we deliberately keep it so the card stays fixable. A company card from a workspace will not reproduce it — it goes through the feed path, which the existing grace check already covers.Rather than waiting 90 days for real data, paste this in the browser console on a dev build to put your existing personal card into exactly that state:
Account > Wallet > Add personal card). Run the script withDAYS_AGO = 1.DAYS_AGO = 100.Walletpage: still listed with its own red dot, and opening it still shows "Your card connection is broken." with a working Fix card button (the error is kept so it stays fixable).RESET = trueto put the card back to healthy.You can also read the underlying state directly instead of eyeballing the dots:
shouldShowRBRis what drives theAccount/Walletred dots;isFeedConnectionBrokendrives the Home task. Onmainthe task is correctly gone butshouldShowRBRstaystrue— which is exactly what was reported.Offline tests
Same as the Tests above. This is a derived value computed from data already in Onyx plus the device date, so it behaves identically offline — the task and indicators stay hidden for a past-grace connection, and the card keeps its error and Fix card action.
QA Steps
Please treat this as a regression check around the card feature. Behaviour is the same on all platforms, so any one platform is fine.
Walletpage with its error and a working Fix card button.If a 90-days-broken connection isn't available as test data, the removal is also covered by automated unit tests; the essential manual checks are step 1 (recently-broken still prompts) and step 3 (no regressions).
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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