Clean up stale transaction thread and IOU action#79176
Clean up stale transaction thread and IOU action#79176s77rt wants to merge 6 commits intoExpensify:mainfrom
Conversation
|
@bernhardoj 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] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e7bf37fee
ℹ️ 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".
|
@s77rt do I need to review this, or is this some kind of follow-up PR? |
|
@bernhardoj I think you can review |
|
@s77rt I can't seem to reproduce it following the steps. (tested on web.mp4web2.mp4 |
|
@bernhardoj Can you try add a comment on the expense report before clearing the cache? |
|
@s77rt Still can't reproduce it. w.1.mp4w.2.mp4
I think I ever encounter this issue. When a transaction thread is already created, the one transaction report action will have App/src/libs/ReportActionsUtils.ts Lines 1603 to 1608 in 9bc39b5 So, we end up creating another transaction thread which results in an error. App/src/pages/home/ReportScreen.tsx Lines 540 to 544 in 9bc39b5 Is it the same issue? (But I don't remember how I reproduce the issue) |
|
Actually I'm no longer able to reproduce this case either. Let me look at another case |
|
Ah wait, I can still reproduce. I was testing on another BE branch where the OpenApp returned the IOU report action. But now we don't. So you may have to try with a high traffic account. |
|
Or actually let me see why the IOU report action is not being returned (maybe it should be?) |
|
Hmm this is looking harder to reproduce for some reason 😅 . Basically you need to have the transaction thread have the highest I was able to reproduce but now at the time of writing not really sure how 😁 I always end up in the policy expense chat instead (which seems like a different kind of bug) Screen.Recording.2026-01-12.at.12.26.23.PM.mov |
|
I think I found a more reliable repro steps:
Screen.Recording.2026-01-12.at.2.01.00.PM.mov |
|
Closing in favor of #79356 |
Explanation of Change
When we try to optimistically create a IOU report action and a transaction thread for a transaction that already have that. The request would fail and we'd end up with 2 IOU actions and 2 transaction threads. This causes weird UI. This PR fixes that by clearing the dups in such a case.
Fixed Issues
$ #78898
PROPOSAL:
Tests
For clarification here is before and after:
Screen.Recording.2026-01-09.at.6.59.37.AM.mov
Screen.Recording.2026-01-09.at.7.01.00.AM.mov
Offline tests
Same as Tests
QA Steps
Same as Tests
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