Hide redundant MARKEDREIMBURSED action when report has a sibling IOU pay action - #95015
Draft
MelvinBot wants to merge 1 commit into
Draft
Hide redundant MARKEDREIMBURSED action when report has a sibling IOU pay action#95015MelvinBot wants to merge 1 commit into
MelvinBot wants to merge 1 commit into
Conversation
…tion Co-authored-by: Rory Abraham <roryabraham@users.noreply.github.com>
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
NewDot renders the IOU
payaction in place of theMARKEDREIMBURSEDaction, so the two should never both be displayed on the same report. The existing guard inshouldReportActionBeVisiblehidesMARKEDREIMBURSEDonly when the write-timeoriginalMessage.isNewDotflag is set or the bakedshouldShowisfalse.Both of those signals are computed once, at write time, and persisted into the Onyx update. When a
MARKEDREIMBURSEDaction is created outside a NewDot request (e.g. a background job, then served back viaGetMissingOnyxMessages),isNewDotis unset and a staleshouldShow: truegets baked in — so neither condition fires and the row leaks through alongside the IOUpayaction, producing the duplicate "marked as paid" message.This change stops trusting the stale baked flags and instead derives the answer locally: a new
hasSiblingPayReportActionhelper checks whether the report already contains an IOUpayaction, andMARKEDREIMBURSEDis hidden when it does. This is scoped toMARKEDREIMBURSEDonly (notREIMBURSED), and is purely additive to the existing flag checks, so:MARKEDREIMBURSED+ IOUpayon the same report) → siblingpayexists → hidden → duplicate fixed.MARKEDREIMBURSEDwith no IOUpay→ sibling absent → still visible → no regression.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/636674
PROPOSAL: https://github.com/Expensify/Expensify/issues/636674#issuecomment-4617734150
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review". Please describe what tests you performed that validate your change worked.
Suggested manual test:
MARKEDREIMBURSEDaction — e.g. reproduce via the onboarding "Get paid back by employer" flow, create an expense with a cropped receipt, then open it).payaction (e.g. an OldDot-marked-reimbursed bill/invoice) and verify the "marked as paid" message is still shown.Offline tests
Same as Tests.
QA Steps
// TODO: The human co-author must fill out the QA steps before marking this PR as "ready for review". Please describe what QA needs to validate and what areas to test for regressions.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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