-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix deleted expense is unselected before disappearing #67216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deleted expense is unselected before disappearing #67216
Conversation
|
@hoangzinh 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: HybridAppScreen.Recording.2025-08-22.at.23.22.03.movAndroid: mWeb ChromeScreen.Recording.2025-08-22.at.23.24.34.moviOS: HybridAppScreen.Recording.2025-08-25.at.00.19.07.moviOS: mWeb SafariScreen.Recording.2025-08-25.at.00.20.59.movMacOS: Chrome / SafariScreen.Recording.2025-08-21.at.17.47.55.web.movMacOS: DesktopScreen.Recording.2025-08-21.at.17.49.49.desktop.mov |
src/libs/SearchUIUtils.ts
Outdated
| */ | ||
| function isSearchResultsEmpty(searchResults: SearchResults) { | ||
| return !Object.keys(searchResults?.data).some((key) => key.startsWith(ONYXKEYS.COLLECTION.TRANSACTION)); | ||
| return !Object.values(searchResults?.data).some((data) => 'transactionID' in data && (data as SearchTransaction)?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep the previous code, but add searchResults?.data[key].pendingAction != DELETE? Beside that, can you help to add unit test for this util please?
|
cc @bernhardoj just in case you missed this PR |
|
@hoangzinh sorry, totally missed it. Updated! |
|
@bernhardoj looks like we need to fix some linters here. |
|
Fixed |
| data: { | ||
| personalDetailsList: {}, | ||
| // eslint-disable-next-line @typescript-eslint/naming-convention | ||
| transactions_1: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| transactions_1: { | |
| transactions_1805965960759424086: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to change the ID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, to be identical with transactionID in the body. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't realize that. Updated!
|
@bernhardoj please also don't forget to upload recordings for |
|
Look like the issue is still reproducible in small screen device, when we delete expense in a group of expenses Screen.Recording.2025-08-21.at.17.54.53.mov |
|
Fixed |
|
@bernhardoj Eslint is failed |
|
Fixed |
hoangzinh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
FYI this PR broke grouped headers. Working on a fix here |
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 9.1.99-0 🚀
|
Revert "Merge pull request #67216 from `bernhardoj/fix/66028-deleted-expense-is-unselected-before-remove`
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.1.99-11 🚀
|
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 9.2.0-0 🚀
|
| useSyncFocus(pressableRef, !!isFocused, shouldSyncFocus); | ||
|
|
||
| const pendingAction = | ||
| (item.pendingAction ?? groupItem.transactions.every((transaction) => transaction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have checked if we have transactions in the first place. If we don't, this will return true even though we don't have any pending action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, thanks for pointing @s77rt. @bernhardoj already convered it in this PR #69406
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.2.0-5 🚀
|
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.2.0-5 🚀
|
Explanation of Change
Fixed Issues
$ #66028
PROPOSAL: #66028 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
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))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.mp4
Android: mWeb Chrome
ndroid.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4