Repository navigation
Clear delete navigate back URL when the deleted expense screen unmounts - #105220
David-2002065 wants to merge 12 commits into
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13048d9494
ℹ️ 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".
|
@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] |
|
This PR adds a new |
|
This PR adds a new |
|
This PR adds a new |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@David-2002065 Can you merge the latest main branch? |
|
This PR adds a new |
|
@dmkt9 ready |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.hybrid.mp4Android: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
| const isFocused = useIsFocused(); | ||
| const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL); | ||
| const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.RAM_ONLY_PENDING_TRANSACTION_DELETE_URL); | ||
| const [isTransactionThread = false] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(reportID)}`, {selector: isReportTransactionThread}); |
There was a problem hiding this comment.
Could we subscribe to the parent report and action too? isReportTransactionThread reads both, but this selector only reruns when the thread changes. If the parent data loads later, this stays false and we still skip clearing the URL on native unmount.
There was a problem hiding this comment.
good point, updated. the handler now subscribes to the parent report and parent action too and passes them into a new pure helper isReportTransactionThreadNew, so it rechecks once the parent data loads. added a test where the parent arrives after the thread mounts
| Onyx.get(ONYXKEYS.RAM_ONLY_PENDING_TRANSACTION_DELETE_URL).then((url) => { | ||
| if (!url || doesDeleteNavigateBackUrlIncludeDuplicatesReview(url)) { | ||
| return; | ||
| } | ||
| requestAnimationFrame(clearDeleteTransactionNavigateBackUrl); |
There was a problem hiding this comment.
Let's also cancel the queued animation frame when a new deletion starts. Once the transition callback fires, there's no pending handle left to cancel. If another deletion sets its URL before this frame runs, the old callback clears that new URL and can show Not Found while the screen is closing.
There was a problem hiding this comment.
done, the cancel handle now covers the whole chain: the transition, the Onyx.get result and the queued frame (cancelAnimationFrame). so a new deletion cancels it even after the transition callback already ran. added a test for that case too
…queued clear frame
|
This PR adds a new |
Explanation of Change
On native, deleting an expense leaves
nvp_deleteTransactionNavigateBackURLset. The only clear runs when the deleted screen renders unfocused, but the native stack removes a popped screen without that render, so the URL leaks into the next expense. The first time that expense loses focus (Test Tools, View details, etc.) the URL clears,ReportNotFoundGuardswaps its wrapper, the header remounts and the carousel unmount cleanup wipes the arrow list.This adds
clearDeleteTransactionNavigateBackUrlAfterTransitions, which clears the URL after transitions, and calls it on unmount inDeleteTransactionNavigateBackHandlerandSearchMoneyRequestReportPage. It reads the URL when it fires since the unmounting screen may not have it yet, and keeps the duplicates review exclusion. On web the existing blur path already clears it, so this is a no-op there.Fixed Issues
$ #103403
PROPOSAL: #103403 (comment)
Tests
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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
103403_android.mp4
Android: mWeb Chrome
103403_after_fix_mweb_chrome.mp4
iOS: Native
103403_after_fix_ios_native.mp4
iOS: mWeb Safari
103403_after_fix_mweb.mp4
MacOS: Chrome / Safari
103403_after_fix_web_chrome.mp4