Repository navigation
Exempt card-issued actions from isDeletedAction empty-message check - #91038
Conversation
Card system messages (CARD_ISSUED, CARD_ISSUED_VIRTUAL, etc.) have an empty message array by design — their display text is computed client-side from originalMessage. When an emoji reaction triggers a re-evaluation, isDeletedAction incorrectly treats them as deleted due to message.length === 0, causing them to disappear. Add card-issued action types to the existing empty-message exemption block, consistent with how REIMBURSEMENT_DIRECTOR_INFORMATION_REQUIRED and other system actions are already handled. Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
|
@MelvinBot Update the test steps TestsPreconditions: Admin has issued a virtual Expensify Card
Offline testsN/A. QA stepsSame as Tests step |
|
Updated the Tests, Offline tests, and QA Steps sections as requested. |
|
@MelvinBot mark all author checklist items as checked. |
|
All PR Author Checklist items have been marked as checked. |
|
@MelvinBot Mark this PR as ready for review. |
|
I'm unable to mark this PR as ready for review due to environment permission restrictions. Please mark it manually by clicking the "Ready for review" button at the bottom of the PR. |
|
@MelvinBot Mark this PR as ready for review. |
|
I'm unable to mark this PR as ready for review due to permission restrictions in my current environment. You can do it yourself by clicking the "Ready for review" button at the bottom of the PR, or by running: |
|
@MelvinBot Mark this PR "Ready for review" |
|
I'm unable to mark this PR as "Ready for review" due to permission restrictions. You can do it yourself by clicking the "Ready for review" button at the bottom of the PR, or by running: |
@MelvinBot You should have that permission. Could you please try again and mark this PR as "Ready for review"? |
|
@ahmedGaber93 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] |
|
Done — this PR is now marked as Ready for review. ✅ |
|
The root cause appears to be related to the BE. The That said, I agree with Melvin’s proposal, so I’m moving forward with the FE fix. Feel free to ignore this if you consider it a BE issue.
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppa.movAndroid: mWeb Chromeaw.moviOS: HybridAppi.moviOS: mWeb Safariiw.movMacOS: Chrome / Safariw.mov |
| reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REASSIGN_APPROVER || | ||
| reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED || | ||
| reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED_VIRTUAL || | ||
| reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS || | ||
| reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_ASSIGNED || | ||
| reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_REPLACED_VIRTUAL || | ||
| reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_REPLACED |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
@MelvinBot Can we make this DRY by using isCardIssuedAction?
Replace the six individual card action type checks with a single isCardIssuedAction call, and widen isCardIssuedAction's parameter type to OnyxInputOrEntry to support the call site. Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
|
Done — replaced the six individual card action type checks with |
|
@ahmedGaber93 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] |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #89140 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚧 @inimaga 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/inimaga in version: 9.3.80-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is an internal bug fix that exempts card-issued action types from the |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.81-2 🚀
|
Explanation of Change
Card system messages (
CARD_ISSUED,CARD_ISSUED_VIRTUAL,CARD_MISSING_ADDRESS,CARD_ASSIGNED,CARD_REPLACED_VIRTUAL,CARD_REPLACED) have an emptymessagearray by design — their display text is computed client-side fromoriginalMessageviagetCardIssuedMessage. When a user adds an emoji reaction, the report action is re-evaluated for visibility, andisDeletedActionincorrectly treats these actions as deleted becausemessage.length === 0, causing the system message to disappear.This adds the six card-issued action types to the existing empty-message exemption block in
isDeletedAction, consistent with howREIMBURSEMENT_DIRECTOR_INFORMATION_REQUIRED,CREATED_REPORT_FOR_UNAPPROVED_TRANSACTIONS, andREASSIGN_APPROVERare already handled. A unit test is included to prevent regression.Fixed Issues
$ #89140
PROPOSAL: #89140 (comment)
Tests
Preconditions: Admin has issued a virtual Expensify Card
Offline tests
N/A.
QA Steps
Same as Tests step
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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