[CP Staging] Revert "Fix empty view shows briefly when sorting"#97015
Closed
yuwenmemon wants to merge 1 commit into
Closed
[CP Staging] Revert "Fix empty view shows briefly when sorting"#97015yuwenmemon wants to merge 1 commit into
yuwenmemon wants to merge 1 commit into
Conversation
|
@parasharrajat 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] |
Contributor
|
🚧 yuwenmemon has triggered a test Expensify/App build. You can view the workflow run here. |
Contributor
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
51 tasks
Contributor
|
@yuwenmemon we can close this. QA team confirmed it's not reproducible anymore. |
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.
@mollfpr please review
cc @aimane-chnaif @dmkt9
Explanation of Change
Reverts #96700, which made
isSearchDataLoadedrecompute the search hash from the (mutable)sortBy/sortOrdersnapshot fields instead of comparing directly againstqueryJSON.hash. During the optimistic empty-report-create flow those fields can be out of sync for a render or two, so the loaded/not-loaded check flips, the stable-data effect inuseSearchSnapshot/useStableOptimisticSortedDatare-fires every render, and the app hitsMaximum update depth exceeded— a hard crash. This is the deploy blocker.Because #96918 landed on top of #96700 to add null-safety around the same function, GitHub's automatic revert conflicted and couldn't be applied. The sort-hash recompute was undone by hand here while keeping #96918's optional chaining on
searchResults.search.Reverting reintroduces the original cosmetic bug from #96074 (the search results table can flash an empty state for a moment when changing sort) — an acceptable tradeoff against the crash.
Fixed Issues
$ #96946
PROPOSAL: N/A
Tests
Offline tests
Same as tests — step 1 requires forcing offline mode to reach the pending-write path that crashes.
QA Steps
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)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 — revert.
Android: mWeb Chrome
N/A — revert.
iOS: Native
N/A — revert.
iOS: mWeb Safari
N/A — revert.
MacOS: Chrome / Safari
N/A — revert.