Skip to content

[codex] Fix desktop preview event delivery errors#3435

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/desktop-preview-event-errors
Jun 20, 2026
Merged

[codex] Fix desktop preview event delivery errors#3435
juliusmarminge merged 1 commit into
mainfrom
codex/desktop-preview-event-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • route preview event broadcasts through ElectronWindow.sendAll so list, inspection, and send failures keep structured window/channel diagnostics and their true causes
  • make preview subscriptions effectful and isolate/log non-interruption listener failures without blocking later listeners
  • preserve interruption and add behavioral coverage for continued delivery, structured logging, and interruption

Validation

  • vp test run apps/desktop/src/preview/Manager.test.ts
  • vp run --filter @t3tools/desktop test (40 files, 218 tests)
  • vp check
  • vp run typecheck

Note

Medium Risk
Touches main-process preview→renderer event plumbing; behavior changes around listener errors could affect UI updates if misconfigured, though failures are now contained and better logged.

Overview
Preview IPC no longer loops BrowserWindow directly; state, recording, and pointer events are broadcast via ElectronWindow.sendAll, so send failures surface as structured ElectronWindowOperationError diagnostics (window id, channel, cause).

PreviewManager preview subscriptions are now effectful (Effect<void>). A shared deliverEvent path logs and isolates non-interruption listener failures so one bad subscriber does not block others, while interruptions still propagate. Tests cover continued delivery after a failing listener, structured logging, and non-swallowed interruption.

Reviewed by Cursor Bugbot for commit 9bc6ab9. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix desktop preview event delivery errors by making listeners effectful in PreviewManager

  • Changes the Listener, RecordingFrameListener, and PointerEventListener type aliases in Manager.ts to return Effect.Effect<void> instead of void, making all event delivery effectful.
  • Adds a deliverEvent helper that catches listener failures: non-interrupt failures are logged as warnings while delivery continues; interrupt causes are re-propagated.
  • Replaces direct BrowserWindow broadcasting in preview.ts with ElectronWindow.sendAll via the Effect environment.
  • Behavioral Change: event delivery no longer silently ignores listener failures — errors are now logged and interrupts propagate up.

Macroscope summarized 9bc6ab9.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e267d100-98a2-45ae-b18a-81d4a87fc315

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/desktop-preview-event-errors

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

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This is a self-contained bug fix that improves error isolation for preview event delivery. The changes replace a local broadcast implementation with an existing centralized method, add proper Effect error handling, and include comprehensive tests for the new behavior.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge merged commit b6c590a into main Jun 20, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/desktop-preview-event-errors branch June 20, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant