Fix: open expense report (not pay message thread) for paid expenses in Recently added - #99668
Fix: open expense report (not pay message thread) for paid expenses in Recently added#99668MelvinBot wants to merge 1 commit into
Conversation
…penses in Recently added Co-authored-by: Georgia Monahan <grgia@users.noreply.github.com>
|
🚧 grgia has triggered a test Expensify/App build. You can view the workflow run here. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🤖 Ran the testing steps from this PR on Android (standalone NewDot). Outcome: ❌ FAIL — the payment flow works and the paid expense shows up in Home "Recently added", but tapping it from "Recently added" still opens the "marked as paid" system-message thread instead of the expense report. The regression this PR is meant to fix reproduced twice with fresh element refs. The actual expense report was only reachable by additionally tapping the "paid" link inside that thread.
Note: mid-test an Android "Allow notifications?" system permission dialog briefly intercepted taps (device/OS interstitial, not an App bug); it was dismissed and the flow continued normally. ScreenshotsHome → Recently added (paid expense visible) FAIL: tapping Recently added opens the "marked as paid" thread For contrast: the actual expense report (reached via in-thread paid link) |
|
🤖 Ran the testing steps from this PR on Web (dev NewDot). Outcome:
Recommend a clean re-run against a real registered second test account to clear the ScreenshotsHome → Recently added (paid expense visible) PASS: opening from Recently added shows the expense report detail view |









Explanation of Change
When paying someone in a 1:1 DM and marking it as paid, the transaction has two IOU actions with the same
IOUTransactionID: the original money-request (CREATE) action, whosechildReportIDis the expense/transaction thread, and the PAY action, whosechildReportIDis the "marked as paid" system message thread. The Home "Recently added" slot resolves each expense's action viagetIOUActionForTransactionID, a first-match.find()that can return the PAY action.getReportIDToOpenForExpensethen navigated straight to that action'schildReportID, so opening the paid expense from "Recently added" opened the "marked as paid" message thread instead of the expense report.This adds an
isSentMoneyReportActionguard ingetReportIDToOpenForExpense: when the resolved action is a sent-money (pay) action, it navigates to the parent report (the expense report) rather than the pay action's message thread. This mirrors how the Search page routes single-transaction reports to the report itself. A unit test covers the new behavior.Fixed Issues
$ #99611
PROPOSAL: #99611 (comment)
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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