Filter DELETE-pending transactions out of LHN RBR aggregation - #97706
Open
dilshodmackbook-sketch wants to merge 1 commit into
Open
Filter DELETE-pending transactions out of LHN RBR aggregation#97706dilshodmackbook-sketch wants to merge 1 commit into
dilshodmackbook-sketch wants to merge 1 commit into
Conversation
Reverting a split leaves the split child transaction in Onyx marked pendingAction DELETE until the server confirms. getViolatingReportIDForRBRInLHN counted that lingering transaction's violation and kept the report's red-dot lit, while the opened report (which filters DELETE-pending transactions) looked clean. Filter DELETE-pending transactions from the RBR aggregation, mirroring the empty-report check in the same file. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@marufsharifi 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] |
melvin-bot
Bot
requested review from
garrettmknight
and removed request for
a team
August 3, 2026 20:19
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
Reverting a split on a report removes the split child transaction(s) optimistically — they are marked with
pendingAction: DELETEand stay in Onyx (with theirreportIDand theirtransactionViolationsentry) until the server confirms and nulls them.The LHN red-dot (RBR) is computed by
getViolatingReportIDForRBRInLHNinsrc/libs/ReportUtils.ts. It built the report's transaction set with a plaingetReportTransactions(...)and did not exclude transactions that are pending deletion. That set is passed down intohasVisibleViolationsForUser/hasViolations/hasWarningTypeViolations/hasNoticeTypeViolationsForRBRInLHN, each of which readstransactionViolations_<transactionID>for every transaction — so aDELETE-pending transaction whose violation entry still existed kept the red dot lit.Meanwhile the report contents (and the sibling "is this report empty" check a few lines above in the same file) already filter out
DELETE-pending transactions, which is why the opened report looked clean. The LHN aggregation and the report view disagreed about whether the reverted transaction still existed.This PR makes the RBR aggregation ignore transactions that are already pending deletion, mirroring the empty-report check in the same function:
Because this filtered array is the one handed to every downstream violation check, the single change fixes the whole RBR path in one place and keeps the LHN consistent with what the opened report actually renders — for reverted splits and any other flow that leaves a transaction queued for deletion.
A unit test was added to
tests/unit/ReportUtilsTest.tscovering the case where the only violating transaction isDELETE-pending, assertinggetViolatingReportIDForRBRInLHNreturnsnull.Fixed Issues
$ #96967
PROPOSAL: #96967 (comment)
Tests
Offline tests
QA Steps
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
96967-android.mp4
Android: mWeb Chrome
video_2026-08-04_00-12-57.mp4
iOS: Native
96967-ios.mp4
iOS: mWeb Safari
video_2026-08-04_00-12-59.mp4
MacOS: Chrome / Safari
96967-macos-chrome.online-video-cutter.com.mp4