Skip to content

fix(lint): merge duplicate type imports in the mobile RPC recording adapters - #20896

Closed
brennanb2025 wants to merge 1 commit into
mainfrom
brennanb2025/fix-mobile-duplicate-type-imports
Closed

brennanb2025 wants to merge 1 commit into
mainfrom
brennanb2025/fix-mobile-duplicate-type-imports

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2

main's tip currently fails pnpm run audit:code-quality:native — the Enforce focused code-quality plugins step of the static analysis CI gate — which blocks every open PR:

mobile/src/test-support/rpc-recording/adapters/push-registration-mount-adapters.ts:1:40: warning import(no-duplicates): Modules should not be imported multiple times in the same file
mobile/src/test-support/rpc-recording/adapters/agent-history-mount-adapters.ts:3:40: warning import(no-duplicates): Modules should not be imported multiple times in the same file

Both adapters were added in #20702 with two separate import type statements pointing at the same module (../operation-module-loader) — one for OperationExposure, one for operationModuleLoader. import(no-duplicates) flags the pair, and --deny-warnings turns it into a failing gate.

This merges each pair into a single import type statement. Same module specifier, same bindings, same type-only import kind, so there is no semantic change — the sibling settings-mount-adapters.ts is untouched because its two imports differ in kind (one value, one type), which the rule permits.

Visual Proof

N/A — lint-only import merge, no runtime or UI behavior change.

Testing

  • oxlint --config config/oxlint-code-quality-native-plugins.json src config tests mobile --deny-warnings exits 0 on this branch; the identical command exits 1 with the two warnings above on main's tip.
  • Instrumented the gate rather than trusting a silent pass: re-introducing one duplicate makes the same command exit 1 with exactly that one warning, confirming the rule is live on these paths.
  • oxfmt --check clean on both files.
  • Mobile tsc was not run (mobile dependencies are not installed in this worktree). The change cannot affect types: operationModuleLoader was already imported from this exact specifier as a type-only binding, so the merged statement resolves identically.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: f71aa8f3-53b2-4f72-addf-63d083e1bb16

📥 Commits

Reviewing files that changed from the base of the PR and between e7206f6 and c29576f.

📒 Files selected for processing (2)
  • mobile/src/test-support/rpc-recording/adapters/agent-history-mount-adapters.ts
  • mobile/src/test-support/rpc-recording/adapters/push-registration-mount-adapters.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The change consolidates duplicate type imports in agent-history-mount-adapters.ts and push-registration-mount-adapters.ts. Each file now combines OperationExposure and operationModuleLoader in one import statement. No logic, public declarations, or behavior changed.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to c2957

This is a localized lint fix with no demonstrated runtime or user-impacting behavior change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem, the change, the testing performed, and the absence of UI changes. However, it omits required template sections, including the linked issue, ELI5, explicit Why and… Add the missing required template sections. Include a valid Fixes #<issue-number> reference, an ELI5 summary, explicit What Changed and Why sections, AI Disclosure if applicable, Review and Agent skill upstream boundary confirmations, Not…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: merging duplicate type imports in the mobile RPC recording adapters.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, the change, the testing performed, and the absence of UI changes. However, it omits required template sections, including the linked issue, ELI5, explicit Why and What Changed headings, review and boundary confirmations, notes, and checklist items.

Resolution

Add the missing required template sections. Include a valid Fixes #&lt;issue-number&gt; reference, an ELI5 summary, explicit What Changed and Why sections, AI Disclosure if applicable, Review and Agent skill upstream boundary confirmations, Notes for compatibility considerations, and completed Checklist items.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — lint-only merge of duplicate type imports in two mobile RPC recording adapters.

  • agent-history-mount-adapters.ts — collapsed OperationExposure and operationModuleLoader into one import type from ../operation-module-loader.
  • push-registration-mount-adapters.ts — same merge.

operationModuleLoader appears only in typeof position (ReturnType<typeof operationModuleLoader>), so the type-only merged import resolves identically. Verified the gate: oxlint --config config/oxlint-code-quality-native-plugins.json over both files and the whole mobile tree (1803 files) exits 0 with zero warnings, so no other duplicate imports remain.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #20895, which carries the same import merge plus the golden re-record this PR was missing. Editing the two adapter modules shifts adapterSha256 on the goldens recorded through them, so the import merge alone fails 9 mobile recorder tests; #20895 re-records those 9 and bumps the pinned baseline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant