fix: Workspace settings page can be accessible after workspace has been deleted offline#80894
Conversation
…en deleted offline
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@DylanDylann 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6317590e16
ℹ️ 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".
| } | ||
|
|
||
| // We check isPendingDelete and prevIsPendingDelete to prevent the NotFound view from showing right after we delete the workspace | ||
| return (!isEmptyObject(policy) && !isPolicyAdmin(policy) && !shouldShowNonAdmin) || (!shouldShowPolicy && !isPendingDelete && !prevIsPendingDelete); | ||
| return (!isEmptyObject(policy) && !isPolicyAdmin(policy) && !shouldShowNonAdmin) || (!shouldShowPolicy && !(isPendingDelete && !prevIsPendingDelete)); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps |
There was a problem hiding this comment.
Recompute shouldShow when prevIsPendingDelete flips
The new condition relies on prevIsPendingDelete becoming true on a later render to show the NotFound view for pending-delete policies, but prevIsPendingDelete isn’t in the useMemo dependency list. If a user opens a settings link for a workspace that is already pending deletion (e.g., deleted offline), the first render sets prevIsPendingDelete to false and shouldShow to false, and subsequent re-renders won’t recompute the memoized value because policy hasn’t changed. That means the NotFound view never appears and the deleted workspace can still be accessed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
It doesn't seem correct. If we open a setting link of a pending delete workspace, the not found page will appear the first time.
trjExpensify
left a comment
There was a problem hiding this comment.
Makes sense. I do hope one day we can come back and make these pages less generic. 👍
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-02-05.at.14.04.34.movAndroid: mWeb ChromeScreen.Recording.2026-02-05.at.14.02.54.moviOS: HybridAppScreen.Recording.2026-02-05.at.14.01.03.moviOS: mWeb SafariScreen.Recording.2026-02-05.at.13.59.19.movMacOS: Chrome / SafariScreen.Recording.2026-02-05.at.13.48.52.mov |
Additional testBecause we are reverting a part of the change in #75085, we need to retest the previous issue
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-02-05.at.14.05.35.movAndroid: mWeb ChromeScreen.Recording.2026-02-05.at.14.02.43.moviOS: HybridAppScreen.Recording.2026-02-05.at.14.00.45.moviOS: mWeb SafariScreen.Recording.2026-02-05.at.13.55.34.movMacOS: Chrome / SafariScreen.Recording.2026-02-05.at.13.51.33.mov |
|
🚧 @AndrewGable has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 9.3.16-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.16-9 🚀
|
Explanation of Change
fix: Workspace settings page can be accessible after workspace has been deleted offline
Fixed Issues
$ #79448
PROPOSAL: #79448 (comment)
Tests
Offline tests
Same
QA Steps
Same as test
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))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
Screen.Recording.2026-01-29.at.22.04.03.mov
Android: mWeb Chrome
Screen.Recording.2026-01-29.at.22.02.55.mov
iOS: Native
Screen.Recording.2026-01-29.at.22.11.17.mov
iOS: mWeb Safari
Screen.Recording.2026-01-29.at.22.09.15.mov
MacOS: Chrome / Safari
Screen.Recording.2026-01-29.at.21.57.38.mov