Repository navigation
Remove useOnyx loading status reads from workspace member and approval pages - #106374
Conversation
|
@nkdengineer 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] |
Codex Review Summary: ✅ CompletedThis 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: 6ebe366d75
ℹ️ 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".
| // Sending the invitation clears `invitedEmailsToAccountIDsDraft`, so opening this page with an empty draft means | ||
| // the invitation was already sent and we navigate back to the members screen | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps -- the drafts are only read once, when the page opens | ||
| }, []); |
There was a problem hiding this comment.
Reapply the welcome-note draft after its merge completes
When a user types the first custom welcome note and immediately leaves and reopens this page while that draft write is pending, setDraftValues() persists WorkspaceInviteMessageFormDraft with Onyx.merge (src/libs/actions/FormActions.ts:28-29), so formData can still be undefined on this mount and arrive later. This empty dependency array initializes the controlled welcomeNote to the default only once, so the later draft cannot restore the typed text; the previous loading transition reran the effect after the merge completed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I've tested this scenario while recording videos and noticed no issue. Onyx.merge applies the change in a few microtasks, and leaving and reopening the page takes at least a frame, so formData already has the typed text
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-11-10.at.13.26.18.movAndroid: mWeb ChromeScreen.Recording.2026-11-10.at.13.27.46.moviOS: HybridAppScreen.Recording.2026-11-10.at.13.28.52.moviOS: mWeb SafariScreen.Recording.2026-11-10.at.13.25.27.movMacOS: Chrome / SafariScreen.Recording.2026-11-10.at.13.23.50.movScreen.Recording.2026-11-10.at.13.21.16.mov |
|
Note: I'll be OOO tomorrow (national holiday in Poland 🇵🇱 ) |
…atus-pt3 # Conflicts: # src/components/WorkspaceMemberRoleList.tsx
|
Failing checks are coming from main... |
…atus-pt3 # Conflicts: # config/oxlint/oxlint.seatbelt.tsv
mountiny
left a comment
There was a problem hiding this comment.
Thank you @VickyStash @nkdengineer looks good to me
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 mountiny 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/mountiny in version: 9.5.36-0 🚀
|
|
No help site update needed — this PR only removes redundant internal loading checks, without adding a feature, changing documented workflows or labels, or removing a beta gate. |
|
No FullStory changes needed — this PR only refactors redundant Onyx loading checks in existing workspace member and approval pages, without adding new screens, interactions, user-property values, or sensitive content. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
This continues the Workspace cleanup from #105937. This part covers the invite, member and approval workflow pages.
Once the app has started,
useOnyxonly returnsloadingwhen a key has nothing in the cache yet and anOnyx.mergefor it hasn't been applied. None of these pages can run into that:Onyx.set, which updates the cache right away, so they're neverloading.Onyx.set.approvalWorkflow. It's merged only by actions on these same pages. Even when a merge lands on an empty value, the check only covered one render, and in that render the hook already returnsundefined.So I removed the loading checks, the metadata variables, and the code that only ran while loading.
Fixed Issues
$ #104583
PROPOSAL:
Tests
commuterExclusionsandcommuterExclusionsArrangementsbetas on.) Set a workspace address in Overview, then go to Distance rates > Settings > Exclude commutes and choose "Exclude usual commute". Select members, change their office location and work arrangement, and verify both update.Offline tests
Same, as in Tests section
QA Steps
Same, as in Tests section
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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_pt1.mp4
android_pt2.mp4
iOS: Native
ios.mov
MacOS: Chrome / Safari
web.mp4
web_pt2.mp4