[No QA] ai-reviewer: fixes for PERF-14/15/16 violations - #81862
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 898d54101e
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
898d541 to
d764fb0
Compare
Clarify conditions for flagging useEffects that mirror external state values and those that perform async side effects without proper cleanup. Expand DO NOT flag criteria for execution guards and idempotent logic to prevent false positives.
962914a to
cd8cbf8
Compare
|
@mountiny @trjExpensify back to you |
Julesssss
left a comment
There was a problem hiding this comment.
Thanks for improvements, lets try again
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.16-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.16-9 🚀
|
@mountiny @kacper-mikolajczak
Explanation of Change
PERF-14: Changed from effect-level evaluation ("The Effect's only purpose") to per-state-variable evaluation. Now
the rule flags individual setState calls that directly mirror external values, even if the same effect manages other state for
different purposes. The "DO NOT flag" exclusion now only applies to the specific state variable under consideration, not the entire
effect.
PERF-15: Broadened from setState-only scope to cover all side effects. "Written to state via setState" became
"performs side effects (setState, navigation, data mutations, deletions)". The "fire-and-forget" exclusion now requires the
operation to be truly safe (just logging/analytics), and the empty dependency array exclusion now requires the async callback to
only perform idempotent/safe operations.
PERF-16: Clarified the distinction between execution guards and data validation guards. A proper execution guard
must check a flag AND set it (if (didInit) return; didInit = true;). Conditional checks on data/props are explicitly called out as
NOT being execution guards. Added a note that navigation and data deletion are NOT idempotent.
Fixed Issues
$ #74367
PROPOSAL:
Tests
Offline 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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari