[codex] Fix desktop preview event delivery errors#3435
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: 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. |
Summary
ElectronWindow.sendAllso list, inspection, and send failures keep structured window/channel diagnostics and their true causesValidation
vp test run apps/desktop/src/preview/Manager.test.tsvp run --filter @t3tools/desktop test(40 files, 218 tests)vp checkvp run typecheckNote
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
BrowserWindowdirectly; state, recording, and pointer events are broadcast viaElectronWindow.sendAll, so send failures surface as structuredElectronWindowOperationErrordiagnostics (window id, channel, cause).PreviewManager preview subscriptions are now effectful (
Effect<void>). A shareddeliverEventpath 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
PreviewManagerListener,RecordingFrameListener, andPointerEventListenertype aliases in Manager.ts to returnEffect.Effect<void>instead ofvoid, making all event delivery effectful.deliverEventhelper that catches listener failures: non-interrupt failures are logged as warnings while delivery continues; interrupt causes are re-propagated.BrowserWindowbroadcasting in preview.ts withElectronWindow.sendAllvia the Effect environment.Macroscope summarized 9bc6ab9.