Repository navigation
Conversation
| // Check for fraud on any Expensify card (physical or virtual) | ||
| if (isCardWithPotentialFraud(card)) { | ||
| // Check for fraud on any Expensify card (physical or virtual). | ||
| // Only include cards that have complete possibleFraud data with a valid fraudAlertReportID, |
There was a problem hiding this comment.
Do we know why some cards do not have the complete possibleFraud data?
There was a problem hiding this comment.
It is a new property that was not saved until recently. So there could be old alerts that do not have this saved in cards data and in that case, we cannot really show this actionable button as we do not know where exactly to link them (100% reliably)
|
@MariaHCD Yeah those changes are from different branch, I will update |
The Time Sensitive section could render as an empty block (title only, no widgets) when the visibility guard and the actual render conditions were out of sync. Root cause: timeSensitiveCardsSelector included fraud cards that had the fraud flag set (e.g. card.fraud === 'domain') but lacked the possibleFraud data or a valid fraudAlertReportID needed by the ReviewCardFraud widget to actually render. The hasAnyTimeSensitiveContent guard said "show the section" while every child returned null. Changes: - Tighten timeSensitiveCardsSelector to require possibleFraud.fraudAlertReportID - Align hasAnyTimeSensitiveContent guard with all render conditions - Add 6 unit tests covering the exact edge cases that caused the bug Co-authored-by: Cursor <cursoragent@cursor.com>
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
Oh, looks like the PR author checklist is incomplete! |
|
Useless cursor |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.19-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.19-5 🚀
|
Explanation of Change
The Time Sensitive section on the Home page could render as an empty block (title with no widgets) when the visibility guard
hasAnyTimeSensitiveContentevaluated totruebut all child widgets returnednull.Root cause:
timeSensitiveCardsSelectorincluded fraud cards that had thecard.fraudflag set (e.g.'domain') but lacked thepossibleFrauddata or a validfraudAlertReportIDthat theReviewCardFraudwidget needs to actually render. The guard said "show the section" while every child returned null.Fix (3 changes):
timeSensitiveCardsSelector— only include fraud cards that have completepossibleFrauddata with a validfraudAlertReportIDhasAnyTimeSensitiveContentguard — make every condition in the guard match the exact render conditions (e.g.shouldShow25off && !!discountInfoinstead of justshouldShow25off)Fixed Issues
$ #82401
Tests
fraudflag set to'domain'or'individual'but withoutpossibleFraudNVP datanpx jest tests/unit/selectors/CardTest.ts(47 tests, all passing)Offline tests
N/A — this is a display-only fix for guard/render condition alignment.
QA Steps
Overall, verify all the time-sensitive actions work as expected
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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