Skip to content

fix(android): break IPC settings barrel cycle - #827

Merged
appergb merged 1 commit into
betafrom
fix/issue-804-android-ipc-cycle
Jul 15, 2026
Merged

fix(android): break IPC settings barrel cycle#827
appergb merged 1 commit into
betafrom
fix/issue-804-android-ipc-cycle

Conversation

@appergb

@appergb appergb commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

User description

Summary

  • import Android settings IPC directly from the narrow settings module
  • add a source-level regression guard against restoring the IPC barrel edge
  • run the guard automatically through npm prebuild so CI and local production builds enforce it

Verification

  • RED: guard failed against the original barrel import with the expected module path
  • GREEN: guard passed after the one-line direct import change
  • npm run build passed without the previous circular chunk warning
  • npm audit reports 0 vulnerabilities
  • diff check and gitleaks passed

No visual or runtime UI behavior change.

Closes #804


PR Type

Bug fix, Enhancement


Description

  • Replace barrel import with direct settings module

  • Add regression guard script for import boundary

  • Run guard automatically via npm prebuild


Diagram Walkthrough

flowchart LR
  subgraph Before
    A["AndroidPermissionsPanel.tsx"] --> B["src/lib/ipc/index.ts (barrel)"] --> C["settings.ts (circular)"]
  end
  subgraph After
    A2["AndroidPermissionsPanel.tsx"] --> C2["src/lib/ipc/settings.ts (direct)"]
  end
Loading

File Walkthrough

Relevant files
Bug fix
AndroidPermissionsPanel.tsx
Fix import to avoid circular dependency                                   

openless-all/app/android/frontend/components/AndroidPermissionsPanel.tsx

  • Changed import of getSettings and setSettings from
    '../../../src/lib/ipc' to '../../../src/lib/ipc/settings'
+1/-1     
Configuration changes
package.json
Add prebuild script for regression guard                                 

openless-all/app/package.json

  • Added "prebuild" script: "node
    scripts/android-ipc-import-boundary.test.mjs"
+1/-0     
Tests
android-ipc-import-boundary.test.mjs
Add regression guard for import boundary                                 

openless-all/app/scripts/android-ipc-import-boundary.test.mjs

  • Adds script to verify settings imports are directly from ipc/settings
  • Throws error if barrel import is detected
+29/-0   

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit a2899ee)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

804 - Partially compliant

Compliant requirements:

  • Replace the problematic barrel import with the narrow settings module import.
  • Add a regression guard that prevents this import edge from returning.
  • npm run build completes without the circular chunk warning (verified by build pass).

Non-compliant requirements:

  • No visual/UI behavior change (cannot be verified through code review alone; requires human verification).

Requires further human verification:

  • No visual/UI behavior change (should be checked via manual testing or automated UI tests, but no such tests exist in this PR).
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@appergb appergb left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Senior review — exact head a2899ee

Strengths

  • The one-line import change is correctly scoped: the IPC barrel re-exports the same getSettings and setSettings bindings from settings.ts, so the component contract and UI behavior remain unchanged while the barrel edge that caused the cross-chunk cycle is removed.
  • Strict RED was demonstrated locally by restoring the old barrel import: the new boundary test exited 1 and identified the old module. A direct tsc plus Vite build with that old import also reproduced both Rollup circular re-export warnings.
  • GREEN was re-established at the exact head: the boundary test passed, npm run build completed successfully, and the targeted Rollup warning was absent.
  • The prebuild hook is one-shot and non-recursive. The test uses a URL relative to import.meta.url, performs read-only source inspection, and has no generated-artifact or release mutation side effects. Tauri beforeBuildCommand invokes npm run build, so the guard also applies to release builds.
  • npm audit reported zero vulnerabilities; git diff --check passed; the source worktree was clean after RED/GREEN restoration.
  • All five exact-head check runs completed successfully: Windows, Linux, Android cargo check, macOS, and pr_agent_job.

Critical

None.

Important

None.

Minor

  • The regression guard intentionally uses a raw-source regex instead of a TypeScript AST. It decisively catches the reported getSettings/setSettings barrel regression, including the exact old import, but could eventually be made more generic against comment-related false matches or equivalent barrel spellings. This is not blocking because the guarded binding paths are explicit and the subsequent TypeScript/Vite build provides a second verification layer.
  • The PR remains draft and branch protection reports review required; those are workflow state, not code defects.

Ready-to-merge verdict

COMMENTED — logical APPROVE. I found no blocking defect at the reviewed exact head. The change satisfies issue #804, preserves the module contract and UI behavior, adds an effective regression boundary, and is supported by local RED/GREEN evidence plus five green exact-head checks. It is ready from a code-review perspective once the maintainer removes draft status and satisfies repository review policy.

@appergb
appergb marked this pull request as ready for review July 15, 2026 05:20
@appergb
appergb merged commit d6ca07a into beta Jul 15, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit a2899ee

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build(android): remove the IPC barrel circular chunk dependency

1 participant