Repository navigation
Add an audit trail for receipt additions - #103279
arosiclair merged 17 commits into
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
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.
|
|
@MelvinBot review |
Code reviewThe overall approach works. Each receipt request now carries its own audit action IDs, so dropping 1. "Removed" and "added" can show in the wrong order on a replaceIn
Fix: Get the time once with 2. Offline "add, then replace" shows no "removed a receipt" messageThe removed action only appears when Steps to reproduce:
Only "added a receipt" shows. The "removed" message never appears optimistically, and the backend's version has no ID to reconcile with. Test case 3 doesn't catch this because it never replaces a receipt that was added offline. Fix: Check for any existing receipt, for example 3. Minor: the self DM fallback only covers the receipt modalThe new In self DM, replacing a receipt through drag-and-drop, the receipt view, or the scan edit flow still shows no optimistic audit messages. Think about moving the fallback into a shared helper. 4. Please confirm backend support
I reviewed the code only and didn't run the test steps. |
|
@MelvinBot BE is working well. Pls review again. Is it ok now? |
|
Yes, this looks good now. Commit
I didn't find any new problems. Map-distance expenses carry a map image as I reviewed the code only and didn't run the test steps. |
|
🚧 flaviadefaria has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@truph01 could you please review it? |
|
Just tested and it seems to be working as expected 🙌 |
Co-authored-by: Andrew Rosiclair <arosiclair@gmail.com>
Co-authored-by: Andrew Rosiclair <arosiclair@gmail.com>
|
@MelvinBot Is the failing ts check related to this PR? |
|
No, the failing All 3 errors are in Evidence
|
|
Can we try to merge this today? |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 arosiclair 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/arosiclair in version: 9.5.9-0 🚀
|
|
No help site update needed. Attach and edit receipts on expenses already says that adding or replacing a receipt posts an "added a receipt" message and that removing one also posts a system message. This PR keeps that behavior true, so no sentence in the article is now wrong. |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.9-4 🚀
Bundle Size Analysis (Sentry): |
|
@MelvinBot Could you identify the PR that introduced the bug fixed by this PR and add a brief comment summarizing the bug and its root cause in that PR? |
|
This PR fixed two bugs, and each came from a different PR. I posted a root-cause comment on each one: The second bug changes your earlier checklist answer. Only the reordering was there before. The missing "added a receipt" message is a regression from that PR, because it added the rollback that deletes the message. Root causes
|
| checkAndFixConflictingRequest: (persistedRequests) => resolveDetachReceiptConflicts(persistedRequests, parameters, transactionThreadReportID), | ||
| }, | ||
| ); | ||
| API.write(WRITE_COMMANDS.DETACH_RECEIPT, parameters, {optimisticData, successData, failureData}); |
There was a problem hiding this comment.
This call lost the checkAndFixConflictingRequest option, and the PR also removed resolveDetachReceiptConflicts. That resolver was what dropped the older queued ReplaceReceipt requests for the same transaction once a detach was queued.
I understand why it went (it also dropped "added a receipt" messages from earlier add/delete cycles), but nothing took its place. Now if you replace a receipt several times offline and then delete it, every ReplaceReceipt gets sent on reconnect: #107135. Fixed in #107358.
Explanation of Change
NewDot now posts an optimistic audit action when a receipt is added or removed, and a replacement shows as a removal followed by an addition.
Fixed Issues
$ #102533
$ #102537
PROPOSAL:
Tests
Test case 1:
Test case 2:
Test case 3:
Test case 4:
Offline tests
Same as above
QA Steps
Same as above
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
Screen.Recording.2026-09-30.at.08.48.12.mov
Screen.Recording.2026-09-29.at.22.54.11.mov
Screen.Recording.2026-09-30.at.08.44.27.mov