[No QA] Fix import/no-cycle - part 6 - #100164
roryabraham merged 5 commits into
Conversation
b99f5bb to
8eb10dc
Compare
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.
|
8eb10dc to
d5ee360
Compare
|
@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] |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
…ssors in StartExpenseFlows
7900c7d to
328c7a1
Compare
|
rebased from main |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-09-11.at.03.40.42.mov |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.4.76-0 🚀
|
|
🤖 No help site changes are required for this PR. I did not create a docs PR. This is a pure internal refactor. It moves three functions out of How I verified thisI diffed every added and removed line and matched them up. Every asymmetric line falls into one of three buckets:
The only user-facing strings in the diff are three
Each appears once as a removed line and once as an added line, byte-identical. The Add expense dropdown options, the Track expense whisper buttons, and the transaction header More actions all render exactly as before. The PR is also labeled @LukasMod, please confirm you agree that no help site update is needed here. If you think a docs change is warranted after all, reply with view run · no recording available |
|
agree that no help site update is needed here |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.76-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Move the expense-flow starters out of
ReportUtils.ReportUtilsimported four action modules. Each import closed a cycle back intoReportUtils:Changes:
GetAddExpenseDropdownOptionsParams/CreateDraftTransactionParamstypes into a newsrc/libs/actions/IOU/StartExpenseFlows.ts.ReportUtils, plus the imports only those functions used.@userActions/IOU/StartExpenseFlows.The new module imports
ReportUtils. That is a one-way edge: nothing inside the cycle cluster importsStartExpenseFlows, so it is a sink and does not get reported.Two things reviewers should look at
1.
createDraftTransactionAndNavigateToParticipantSelectornow reads the current user from its params everywhere.In
ReportUtilsthis function mixed two sources for the same values. It tookcurrentUserAccountIDandcurrentUserEmailas params and used them at three sites, but at seven other sites it readdeprecatedCurrentUserAccountIDanddeprecatedCurrentUserEmail, the module-scopelets thatReportUtilsmirrors fromONYXKEYS.SESSIONviaOnyx.connect. Thoselets cannot be exported (import/no-mutable-exports):The mix was an accident of history, not a design:
deprecated*as a "migrate touseOnyx" marker. No behavior change.createDraftWorkspacecould stop reading the session itself. It replaced only the two reads on that call path and left the rest.deprecatedCurrentUserAccountIDidiom, even though the param was already in scope.2. One
as Transactionassertion moved with the code.In
ReportUtilsan eslint-seatbelt allowance covered it. In a new file it is a hard error, so it carries aneslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion.Effect on
import/no-cycleMeasured with oxlint 1.80.0,
import/no-cycleisolated.mainalonemain+ parts 1-5On its own this removes 6 findings. Once parts 1-5 land it removes 51 findings and 9 files.
npx jest ReportUtilsTest CreateDraftTransactionTest TrackExpenseTest AddExpenseActionButtonTest:Fixed Issues
$ #99650
PROPOSAL:
Tests
Pure code move plus a change of where one function reads the current user's account ID and email. Test the flows that moved and are reachable.
Note: the "Categorize it" and "Share it with my accountant" whisper buttons are behind
Permissions.canUseTrackFlows(), which currently returnsfalse, so theCATEGORIZEandSHAREbranches cannot be reached from the UI. They are covered by unit tests instead (9 direct calls inCreateDraftTransactionTest/TrackExpenseTest).Test 1: Add expense dropdown
Test 2: Track expense whisper
Test 3: Transaction header
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.native.mov
Android: mWeb Chrome
android.web.mov
iOS: Native
ios.native.mov
iOS: mWeb Safari
ios.web.mov
MacOS: Chrome / Safari
web-1.mov
web-2-3.mov