Repository navigation
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@shubham1206agra 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d57514a31b
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 401adaa0dc
ℹ️ 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".
| } | ||
|
|
||
| const key = `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}` as const; | ||
| return allReportActions?.[key] ?? searchData?.[key]; |
There was a problem hiding this comment.
Merge live and snapshot actions before deleting
When live Onyx contains only part of a report's actions—for example after an incremental load or action push—this whole-map ?? discards every action available only in the search snapshot. deleteAppReport iterates the returned map to populate transactionIDToReportActionAndThreadData and optimistically unreport expenses, so those missing CREATE actions leave transactions attached to the deleted report, particularly while offline. Merge the snapshot and live maps with live entries winning per action ID. Fresh evidence beyond the previous thread is that this new helper selects a non-null live dictionary wholesale rather than combining it with the snapshot.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@codex, does it make sense just prioritize snapshot actions then?
There was a problem hiding this comment.
Codex Review: Didn't find any major issues. Bravo.
Reviewed commit: 401adaa0dc
ℹ️ 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".
There was a problem hiding this comment.
Kept as is, added a comment
There was a problem hiding this comment.
@VickyStash I am not sure about keeping this as it is. @mountiny What's your take here?
There was a problem hiding this comment.
So what I'm thinking is that maybe we shouldn't use snapshot report actions in this case at all.
@VickyStash This might backfire when live report action is not present for an expense for some reason. But I think we should be consistent here for getReportActionsFromSearchSnapshot and getReportFromSearchSnapshot.
There was a problem hiding this comment.
This might backfire when live report action is not present for an expense for some reason.
BE should return the correct info in the delete response then, right?
But I think we should be consistent here for
getReportActionsFromSearchSnapshotandgetReportFromSearchSnapshot.
So, returning snapshot result and falling back to live?
There was a problem hiding this comment.
So, returning snapshot result and falling back to live?
Yes, but I would like to hear @mountiny's opinion.
There was a problem hiding this comment.
Hard to judge what will be better, I guess there could be edge cases in both directions. I agree with where you landed though
There was a problem hiding this comment.
returning snapshot result and falling back to live
On my way to apply this, then!
|
@MelvinBot review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfdbbe86e7
ℹ️ 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".
ReviewSolid, well-scoped follow-up. The core change is correct: both Bulk Delete call sites and Bulk Reject now resolve the report snapshot-first via A few things to confirm — none blocking: 1. Reject now reads 2. No unit tests for the new fallback branches. Codecov shows a coverage drop on both files and the diff touches no test files, though the checklist marks "added unit tests." 3. Same-class pattern nearby, out of scope but worth a follow-up. In Minor: the report is resolved snapshot-first while its report actions are resolved live-first (matching the LGTM once (1) and (2) are addressed/confirmed. |
|
I still need to address Melvin's first comment and the Codex comment (they are related). I have some doubts regarding it, maybe for reject flow I'll just add Log for now to monitor and won't change anything to not cause side issues. I'll focus on it tomorrow morning. |
|
@MelvinBot some updates were applied, review |
Re-reviewAll three points from my last pass are addressed cleanly. 👍
Two small, optional notes:
LGTM. Reject edge case can be a fast-follow once the log tells you whether it's worth the risk. |
|
@shubham1206agra Let me know what you think! |
|
@shubham1206agra please prioritize this |
|
@shubham1206agra please continue |
|
@shubham1206agra kind bump ^^ |
|
@shubham1206agra I'll be OOO next week, if possible, let's try to finalize review today |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f95549a6b8
ℹ️ 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".
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-09-04.at.7.12.12.PM.mov |
|
I'll be OOO next week, back on September 14 🌴 |
…985-harden-bulk-rules
|
🚧 mountiny 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/mountiny in version: 9.4.74-0 🚀
|
|
🤖 No help site changes are required for this PR. I did not create a docs PR. Why: this is an internal bug fix with no user-facing change. It changes how Search bulk Delete and Reject resolve a report — preferring the search snapshot over the Onyx What I checkedThe diff touches three files, none of which add, rename, or remove any user-facing feature, tab, setting, or button label:
The help site already documents the behavior this PR restores. Getting Started with the Spend Page tells members to select rows with checkboxes and use the bulk Delete action. That text was already correct — the bug meant it sometimes didn't work, not that the documentation was wrong. Fixing the code makes the existing article accurate again, so nothing needs rewording. I also scanned the rest of @VickyStash, since no documentation update is needed, there is no linked help site PR to review. If you think an article should still be updated, reply with |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.74-2 🚀
|
Explanation of Change
Follow-up to the Search Pay fix (#98760 / #98444): the audit of the other Search bulk actions found two remaining paths that read the report from the Onyx
report_collection only — a collection populated only for reports the user has already opened. The search snapshot always contains the matched expense reports, so both paths degraded silently for reports visible in search results but never opened.Bulk Delete (
src/hooks/useSearchBulkActions.ts): bothdeleteAppReportcall sites looked the report up in Onyx only. When the report wasn't cached,deleteAppReportbailed out early and the selected row was silently skipped. Both call sites now resolve the report viagetReportFromSearchSnapshot(reportID, searchData, allReports).Fixed Issues
$ #98985
PROPOSAL: N/A
Tests
Evicting the report from Onyx in the dev console:
Delete:
Offline tests
Same, as in Tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same, as in Tests
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
MacOS: Chrome / Safari
delete.mp4