[CP Staging] Fix fraud alert widget not rendering due to wrong data path#82247
[CP Staging] Fix fraud alert widget not rendering due to wrong data path#82247
Conversation
|
🚧 @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.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
The card fraud data (possibleFraud) is stored under card.nameValuePairs in Onyx, not under card.message. This mismatch caused the fraud alert widget to never render since card.message?.possibleFraud was always undefined. Additionally, isCardWithPotentialFraud now also checks for the presence of nameValuePairs.possibleFraud, since the card.fraud field may already be reset to 'none' while the fraud alert is still pending review. Co-authored-by: Cursor <cursoragent@cursor.com>
5fa302b to
f51eeb9
Compare
|
@codex review |
Co-authored-by: Cursor <cursoragent@cursor.com>
f51eeb9 to
3221b86
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f51eeb921e
ℹ️ 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".
SummaryThis PR fixes a data path mismatch where fraud alert data ( ✅ What's Good
function isCardWithPotentialFraud(card: Card): boolean {
- return card.fraud === CONST.EXPENSIFY_CARD.FRAUD_TYPES.DOMAIN || card.fraud === CONST.EXPENSIFY_CARD.FRAUD_TYPES.INDIVIDUAL;
+ return card.fraud === CONST.EXPENSIFY_CARD.FRAUD_TYPES.DOMAIN || card.fraud === CONST.EXPENSIFY_CARD.FRAUD_TYPES.INDIVIDUAL || !!card.nameValuePairs?.possibleFraud;
}This handles the edge case where
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
I think the comments are not blocking in the tests, I will move this ahead |
|
🚧 @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! 🧪🧪
|
[CP Staging] Fix fraud alert widget not rendering due to wrong data path (cherry picked from commit fce1364) (cherry-picked to staging by lakchote)
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.3.17-9 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.17-9 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.3.18-0 🚀
|
Explanation of Change
The card fraud data (
possibleFraud) is stored undercard.nameValuePairsin Onyx, not undercard.messageas the code previously assumed. This mismatch caused the fraud alert widget in the Time Sensitive section to never render becausecard.message?.possibleFraudwas alwaysundefined, which meant:ReviewCardFraudcomponent was never shownThis PR:
PossibleFraudDatatype from the removedCardMessagewrapper intoCard.nameValuePairsTimeSensitiveSectionto readcard.nameValuePairs?.possibleFraudinstead ofcard.message?.possibleFraudCardMessagetypepossibleFraudvianameValuePairsFixed Issues
$ #82242
Tests
Testing on the adhoc
Offline tests
N/A - This is a data path fix. The fraud data comes from Onyx which persists offline.
QA Steps
Same as test - InternalQA
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