Skip to content

Restore remote explorer updates after server recovery - #26612

Merged
OrcaWin merged 2 commits into
mainfrom
nwparker/remote-explorer-watch-recovery
Oct 9, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
nwparker/remote-explorer-watch-recovery

Conversation

@nwparker

@nwparker nwparker commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​437 $\color{#cf222e}{\Huge{\mathbf{−}}}$​32 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​405
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​51 $\color{#cf222e}{\Huge{\mathbf{−}}}$​40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11

ELI5

After a Remote server restarts, the file explorer catches up and keeps showing new files without needing to reopen it.

What Changed

The explorer used its own remote file-change subscription. When that stream closed, the app watcher could recover while the explorer kept its abandoned listener. Files could be read from the host and their events reached the app, yet they never appeared in the tree.

Managed explorers now consume the existing app watcher, which #26606 restores after contact returns. Host and workspace-root checks keep events scoped to the displayed tree. Existing refresh scheduling, deferred interaction updates and local/direct SSH listeners remain in use.

Why

The app already owns the watcher for a visible explorer, including a folder workspace with no editor open. Sharing that recovered event source removes a redundant subscriber and avoids maintaining another retry loop. A recovery overflow refreshes files created while the server was unavailable; subsequent events refresh their directories normally.

Linked Issue

Found during SSH → Remote consolidation testing; no existing issue.

Visual Proof

Identical worktree and non-Git folder journeys: the before screenshots omit DURING_OUTAGE.txt and WATCH_RECOVERED.txt even after positive host reads and a real recovered app event. The after screenshots show both files.

explorer-watch-recovery-worktree-before.png
explorer-watch-recovery-worktree-after.png
explorer-watch-recovery-folder-before.png
explorer-watch-recovery-folder-after.png
explorer-watch-recovery-runtime-red-final.log
explorer-watch-recovery-runtime-green-final.log

Testing

  • Exercised a hidden macOS Electron client with owned Linux Docker SSH hosts and the installed production server template.
  • Added four broker regressions and paired worktree/folder server-restart cases, routed to the existing template-building Docker CI lane.

Each real case first proves a live watcher and rendered tree, terminates only the disposable host's server, creates a file during the outage, verifies a replacement server PID and positive host reads, then creates another file and waits for its actual host event. The unchanged parent explorer fails both cases (25.9 s / 25.8 s); the corrected build passes both (15.8 s / 15.9 s, 33.2 s total).

All four new broker regressions fail on the parent. Final affected suite: 125 tests / 13 files pass, covering host/root isolation, overflow resync, owner changes, cleanup, pending refreshes, watch sharing and Docker lane selection. Full pnpm tc, pnpm lint, changed-code quality, standalone React Doctor, fresh E2E build and commit hooks pass.

Review

Stacked on #26606: merge that PR first. Its CI is fully green. The product change is confined to the explorer's remote event source and a typed DOM event declaration, already used identically by #26599.

Agent skill upstream boundary

  • Not applicable; this change copies no upstream skill-installer source or resources.

Notes

No server, RPC or remote wire changes. Outage evidence does not imply process death. Fault injection is restricted to owned Docker hosts. Windows was not runtime-tested. Other conversion findings are separate PRs and may still appear in these baseline logs.

Checklist

  • Small and focused
  • ELI5, before/after, mechanism and approach explained
  • Before/after screenshots and runtime logs attached
  • Self-reviewed for correctness, security and performance
  • Cross-platform, SSH, folder workspace and path ownership considered
  • Local lint, typechecks, affected tests and fresh build pass

@OrcaWin
OrcaWin force-pushed the nwparker/remote-editor-watch-recovery branch from 0c3a32b to 1ce04b2 Compare October 9, 2026 02:27
@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 9, 2026 02:27
@OrcaWin
OrcaWin force-pushed the nwparker/remote-explorer-watch-recovery branch from c365e95 to bdc7f68 Compare October 9, 2026 02:27
@OrcaWin
OrcaWin force-pushed the nwparker/remote-explorer-watch-recovery branch from bdc7f68 to f092245 Compare October 9, 2026 06:03
@OrcaWin
OrcaWin force-pushed the nwparker/remote-editor-watch-recovery branch from 1ce04b2 to 31a0101 Compare October 9, 2026 06:04
@OrcaWin

OrcaWin commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Review fix (restacked on current main): the app watcher decided whether the sidebar needed a watch from the stored sidebar tab. When that tab is hidden for the workspace (for example Source Control on a folder repo or a remote folder workspace), the Explorer is shown as a fallback but nothing was watched, so remote creates and deletes never reached it. The sidebar now publishes the tab it actually shows (rightSidebarEffectiveTab, in memory only), and the watch-target selector uses that tab, falling back to the stored one until the sidebar mounts. Tests: editor-external-watch-fallback-explorer.test.ts and use-right-sidebar-tab-routing.effective-tab.test.tsx.

@OrcaWin
OrcaWin force-pushed the nwparker/remote-explorer-watch-recovery branch from f092245 to 9b2a67c Compare October 9, 2026 06:10
@OrcaWin
OrcaWin force-pushed the nwparker/remote-editor-watch-recovery branch 2 times, most recently from 75c93a0 to c11d9ce Compare October 9, 2026 09:18
@OrcaWin
OrcaWin force-pushed the nwparker/remote-explorer-watch-recovery branch from 9b2a67c to f895e39 Compare October 9, 2026 09:18
@OrcaWin
OrcaWin changed the base branch from nwparker/remote-editor-watch-recovery to main October 9, 2026 11:23
@OrcaWin
OrcaWin force-pushed the nwparker/remote-explorer-watch-recovery branch from bb075c3 to 21737a8 Compare October 9, 2026 11:23
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in 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: bf8d59cf-6593-46df-bc01-0ee363cb5f61

📥 Commits

Reviewing files that changed from the base of the PR and between 4845ae8 and 21737a8.


📒 Files selected for processing (14)
  • .github/workflows/e2e.yml
  • config/scripts/ci-e2e-job-selection.mjs
  • config/scripts/ci-e2e-job-selection.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs
  • src/renderer/src/components/right-sidebar/right-sidebar-titlebar-drag-regions.render.test.tsx
  • src/renderer/src/components/right-sidebar/use-right-sidebar-tab-routing.effective-tab.test.tsx
  • src/renderer/src/components/right-sidebar/use-right-sidebar-tab-routing.ts
  • src/renderer/src/components/right-sidebar/useFileExplorerWatch.broker.test.tsx
  • src/renderer/src/components/right-sidebar/useFileExplorerWatch.pending-refresh.test.tsx
  • src/renderer/src/components/right-sidebar/useFileExplorerWatch.ts
  • src/renderer/src/hooks/editor-external-watch-fallback-explorer.test.ts
  • src/renderer/src/hooks/editor-external-watch-targets.ts
  • src/renderer/src/store/slices/editor/actions/right-sidebar-state.ts
  • tests/e2e/ssh-orcad-explorer-watch-recovery.spec.ts

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



📝 Walkthrough

Walkthrough

The sidebar now records its effective tab, and editor watch-target selection uses that tab when available. The explorer watch hook handles runtime file-change events through a window event and retains the local filesystem listener. A new E2E spec checks explorer file visibility during and after a managed-server outage. CI routes changes to explorer watch files to that spec and runs it in the Docker conversion job.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 21737

The recovered watcher can update the remote Explorer after a server outage. No actionable merge-blocking risk remains after normal checks.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check Warning The description is detailed and covers the change, rationale, testing, visual proof, compatibility notes, and checklist. However, the required Linked Issue section states that no existing issue exists… Add a valid linked issue reference in the Linked Issue section, such as Fixes #<issue-number>. Do not leave the section as “no existing issue.”
Docstring Coverage Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 13 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check Passed The title clearly summarizes the primary change: restoring remote Explorer updates after server recovery.
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 is detailed and covers the change, rationale, testing, visual proof, compatibility notes, and checklist. However, the required Linked Issue section states that no existing issue exists and does not provide an actual issue reference.


Full details: Docstring Coverage

Explanation

Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 13 files. (1 skipped: 1 unsupported.)



  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 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

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

@OrcaWin
OrcaWin merged commit 9be39b6 into main Oct 9, 2026
39 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.

2 participants