Fix crash when deleting split transactions with missing report action#84350
Fix crash when deleting split transactions with missing report action#84350
Conversation
Fixes #84349 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
|
|
@linhvovan29546 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppN/A, it's only a null check → no effect on anything else Android: mWeb ChromeN/A, it's only a null check → no effect on anything else iOS: HybridAppN/A, it's only a null check → no effect on anything else iOS: mWeb SafariN/A, it's only a null check → no effect on anything else MacOS: Chrome / SafariScreen.Recording.2026-03-06.at.16.07.09.mov |
|
Ugh, I don't know why GH isn't working to give me an expensify engineer |
|
@Beamanator I'm assigning you because it's your 5 year work anniversary, congratulations! Your present is you get to review this PR 🎁 😄 |
Explanation of Change
updateSplitTransactionsinSplit.tsuses.find()to locate a report action matching a transaction, then casts the resultas ReportAction— hiding the possibility that.find()returnsundefined. Thisundefinedis passed togetDeleteTrackExpenseInformation, which immediately accesses.childReportID, causing aTypeError.This is why we should avoid using
ascasts.The fix adds a null check before calling
getDeleteTrackExpenseInformation, consistent with howMergeTransaction.tsalready guards its equivalent call. If no matching report action is found, we log a warning and skip that transaction's deletion onyx data.Sentry: APP-714
Fixed Issues
$ #84349
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
N/A — no UI changes
Android: mWeb Chrome
N/A — no UI changes
iOS: Native
N/A — no UI changes
iOS: mWeb Safari
N/A — no UI changes
MacOS: Chrome / Safari
N/A — no UI changes