[No QA] Fix import/no-cycle - part 1 - follow up - #100009
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc25abc138
ℹ️ 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".
7ebbd7f to
9587808
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@thelullabyy 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] |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-09-05.at.03.05.13.mov |
|
🚧 roryabraham 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
@MelvinBot prepare a revert for this PR |
|
🤖 Revert PR is ready as a draft: #100456 It reverts merge commit One thing to know:
Checks I ran locallyAll passing on the revert branch:
Could not run: Mark it "Ready for review" when you want PullerBear to assign a reviewer. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.4.73-0 🚀
|
|
🤖 No help site changes are required. I did not create a docs PR. This PR is an internal refactor only. It converts Nothing customer-facing changed:
The PR title is also already marked Since no docs changes were needed, there is no linked help site PR for you to review or mark |
Explanation of Change
Regarding #99670 (comment)
src/libs/Middleware/register.tsused to run itsaddMiddlewarecalls at module scope, so importing the module was the registration. It now exports a defaultregisterMiddlewares()function that callers invoke, guarded by a module-levelhasRegisteredflag so repeated calls are no-ops.Callers updated from
import '@libs/Middleware/register'to importing and calling the function:src/setup/index.tscalls it first inside the default setup function.storybook/preview.tsxcalls it beforeOnyx.inittests/ui/SearchPageTest.tsxandtests/unit/TransactionGroupListItemTest.tsxcall it at module top leveltests/utils/TestHelper.tscalls it on import, since tests that pull in this helper can issue API calls without going throughsetupApp(). The idempotency guard is what makes this safe alongsidesetupApp()'s own registration.tests/unit/MiddlewareRegistrationTest.tscalls the function instead ofrequire-ing the module, which removes the note aboutjest.isolateModulesbreaking identity checks.The middleware list and its ordering are unchanged, including the constraint that
SaveResponseInOnyxruns last among Onyx-writing middlewares.Why
A bare side-effect import is easy to drop by accident: an import with no binding looks unused, and formatters or import-sorting tools can reorder it relative to code that depends on it having run. Making registration a call means the dependency is visible at the call site and the ordering inside
setup/index.tsis explicit rather than implicit in import order.Fixed Issues
$ #99650
PROPOSAL:
Tests
Offline tests
QA Steps
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
Screen.Recording.2026-09-01.at.12.35.47.mov