Skip to content

fix: repair main's session registry import and isolate the popup Electron fixture - #40074

Merged
AmoabaKelvin merged 2 commits into
mainfrom
fix-browser-extension-commands-import
Nov 9, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
fix-browser-extension-commands-import

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Two things broke main in the last hour. One PR imports a file from a folder it was just moved out of, so main doesn't build. Another made test files share loaded code, and the browser popup tests share a fixture that can't be shared, so they reuse an already-closed browser. This fixes both.

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

What Changed

Why

Together these are why every PR's CI is red right now. The import is the only stale one (grep finds no others). Isolating the fixture matches how it's written, one Electron app per file, rather than reworking it to survive a shared cache.

Linked Issue

N/A, build and test breaks on main.

Visual Proof

N/A, no visible change.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

pnpm tc and pnpm lint pass. browser-extension-commands.test.ts and browser-process-user-agent-ordering.test.ts, which failed in CI on the bad import, pass. Running filesSafeToShareWorker on the popup tests now lists the four fixture users as isolated and the rest as shared. I didn't run the Electron popup tests locally; CI's Linux step covers them. No new tests.

Risk

Low. The import is a path fix. The four popup files go back to one worker each, as before #40067, so the Linux Electron step is a few seconds slower. A revert brings both breaks back.

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The browser extension commands module now imports browserSessionRegistry from sessions/profiles/browser-session-registry. Its test mock now targets the same module path.

Merge Risk: Minimal · up to 8e55d

The registry paths are aligned. No merge-blocking issue was identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Title check Passed The title names the main change: a fix to the session registry import on main, plus isolating the popup Electron fixture. It matches the raw summary's import-path change and the description's fixture …
Description check Passed The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (marked N/A with a reason), Visual Proof (N/A with a reason), Testing, Risk with a level, Agent sk…
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Full details: Title check

Explanation

The title names the main change: a fix to the session registry import on main, plus isolating the popup Electron fixture. It matches the raw summary's import-path change and the description's fixture isolation. The title is 81 characters, slightly above the usual length, but it is specific and not misleading.

Full details: Description check

Explanation

The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (marked N/A with a reason), Visual Proof (N/A with a reason), Testing, Risk with a level, Agent skill upstream boundary, and Checklist. It explains the before and after, the mechanism, and the rollback. Gaps: the AI Disclosure and Review sections are empty, which the template allows for stablyai team members. The Linked Issue section says N/A, although the template says there should always be one for outside contributors. The author is internal, so this does not block the check. The Testing checklist leaves the manual-testing box unchecked and says the Electron popup tests were not run locally.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e51e8168-79ea-4346-9174-d37259f1e576
Commits

Reviewing files that changed from the base of the PR and between 74c1e94 and 8e55d86.

Files selected for processing: 2

  • src/main/browser/extensions/browser-extension-commands.test.ts
  • src/main/browser/extensions/browser-extension-commands.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

#40002 moved browser-session-registry into sessions/profiles, and #39613 landed after it with the old path, so main no longer typechecks or builds.
#40067 lets unit files share a worker's module cache. The popup compatibility fixture keeps its Electron app, mock server and temp root at module level, so after the first file the others reuse a closed browser.
@AmoabaKelvin
AmoabaKelvin force-pushed the fix-browser-extension-commands-import branch from 8e55d86 to 9484111 Compare November 9, 2026 02:42
@AmoabaKelvin AmoabaKelvin changed the title fix(browser): import the session registry from its new profiles folder fix: repair main's session registry import and isolate the popup Electron fixture Nov 9, 2026
@AmoabaKelvin
AmoabaKelvin merged commit e290270 into main Nov 9, 2026
72 of 74 checks passed
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