-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Refactor: isolate requestWorkspaceOwnerChange from Onyx.connect ONYXKEYS.COLLECTION.POLICY #81105
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
base: main
Are you sure you want to change the base?
Refactor: isolate requestWorkspaceOwnerChange from Onyx.connect ONYXKEYS.COLLECTION.POLICY #81105
Conversation
…EYS.COLLECTION.POLICY
|
@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] |
| requestWorkspaceOwnerChange(policyID, currentUserPersonalDetails.accountID, currentUserPersonalDetails.login ?? ''); | ||
| requestWorkspaceOwnerChange(policy, currentUserPersonalDetails.accountID, currentUserPersonalDetails.login ?? ''); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [policyID]); |
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.
❌ CONSISTENCY-5 (docs)
The ESLint rule react-hooks/exhaustive-deps is disabled here, but the comment doesn't explain why it's necessary to bypass the rule.
Additionally, after this refactor, the policy object is now used in the effect body (line 45 in the diff), but it's not included in the dependency array. This could cause stale closures where the effect doesn't re-run when the policy changes.
Suggested fix:
Either add policy to the dependency array, or if you intentionally want this effect to only run once on mount, document why in the disable comment:
// eslint-disable-next-line react-hooks/exhaustive-deps -- This effect should only run once on mount when policyID changes
}, [policyID]);Or update the dependency array to include all dependencies:
}, [policyID, policy, currentUserPersonalDetails.accountID, currentUserPersonalDetails.login]);Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d09c542ec
ℹ️ 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".
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
parasharrajat
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.
one issue.
|
@parasharrajat You can start the review now |
| requestWorkspaceOwnerChange(policyID, currentUserPersonalDetails.accountID, currentUserPersonalDetails.login ?? ''); | ||
| requestWorkspaceOwnerChange(policy, currentUserPersonalDetails.accountID, currentUserPersonalDetails.login ?? ''); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [policyID]); |
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.
shouldn't we check for policy now...
Screenshots01.02.2026_15.33.14_REC.mp4 |
Explanation of Change
Fixed Issues
$ #66565
Tests
Offline tests
Same as Tests
QA Steps
Same as Tests
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
Screen.Recording.2026-01-31.at.5.46.29.PM.mov