Skip to content

refactor(session-tabs): one authority-repair lane shared by every session-tabs mirror - #27093

Merged
OrcaWin merged 1 commit into
mainfrom
np/p395-a1-authority-repair
Oct 10, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
np/p395-a1-authority-repair

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 10, 2026 •

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

ELI5

Behavior-neutral refactor. The desktop keeps a copy of tabs published by a host. When it drops a tab frame because the frame looks like it came from a dead publisher, it can ask the host for a full census to check. Only the local mirror had that repair. This PR moves the repair into a shared module so the paired-host mirror can use it in the next PR in this stack.

What Changed

Before / after for users: none. Same behavior.

Mechanism:

  • local-structured-session-tabs-sync/retired-epoch-repair.ts (the bounded, decaying census scheduler) becomes web-session-tabs-sync/session-tabs-authority-repair.ts, a factory that creates one repair lane per mirror. The census call, the "is this still the same generation" fence and the "is the epoch still retired" check are injected. The local module keeps its exported functions and just binds the shared lane, so its tests are unchanged.
  • The "revive a retired epoch only on an authoritative census" step moves into publisher-identity-fences.ts as admitRetiredValueUnderAuthority, with an optional matcher so the paired mirror can apply it to a whole publication lineage. The now-unused reviveRetiredValue export is removed.

Why

The paired mirror has the same bug the local mirror already fixed (a live publisher returning after a brief headless writer is treated as dead, #21928). Reusing one lane keeps the attempt budget, backoff and decay identical for both mirrors instead of writing a second scheduler.

Linked Issue

Prepares the fix for #21928 (next PR in the stack). No issue is fixed by this PR alone.

Visual Proof

N/A: no behavior change.

Testing

  • retired-epoch-repair.test.ts, local-structured-session-retired-epoch-repair.test.ts and local-structured-session-tabs-sync.test.ts pass unchanged; the web-session-tabs-sync and local-structured-session* suites pass.

  • pnpm tc:web, oxlint, pnpm run check:code-quality:changed.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

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

Renderer-only refactor; no wire, SSH, platform or folder-workspace impact.

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)
  • 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 Oct 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 715e786f-a4de-4231-bd16-c60bd84157e9

📥 Commits

Reviewing files that changed from the base of the PR and between c8b8997 and 85055ff.


📒 Files selected for processing (4)
  • src/renderer/src/runtime/local-structured-session-tabs-sync/retired-epoch-repair.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.ts
  • src/renderer/src/runtime/web-session-tabs-sync/publisher-identity-fences.ts
  • src/renderer/src/runtime/web-session-tabs-sync/session-tabs-authority-repair.ts


  • 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

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

@OrcaWin
OrcaWin merged commit 33d90bb into main Oct 10, 2026
69 of 71 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