-
Notifications
You must be signed in to change notification settings - Fork 27
🤖 fix: prevent IPC send to destroyed window #859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add isDestroyed() checks before all mainWindow.webContents.send() calls to prevent 'Object has been destroyed' errors when the window is closed while background processes (like init stderr streams) are still emitting events. Fixes crash when closing window during workspace initialization.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Integration tests are timing out on preload - this appears to be a transient CI issue unrelated to the IPC fix. The changes only add |
|
Integration tests still failing - looks like CI timing issues with test setup. The optional chaining changes are correct and typecheck passes. @kyle can you check the CI logs? |
|
Added |
|
anthropic1MContext test appears to be timing out waiting for stream-end event - possibly a flaky integration test unrelated to the IPC fix. Retriggering to confirm... |
## Summary Add comprehensive E2E tests covering window lifecycle, IPC robustness, streaming edge cases, persistence, and error display. These tests target recent regression patterns. ## Recent Regressions Addressed | Regression | Test Coverage | |------------|---------------| | `MockBrowserWindow.isDestroyed()` (#863) | IPC stability tests verify no crashes during heavy IPC | | IPC send to destroyed window (#859) | `ipcRobustness.spec.ts` - concurrent IPC operations | | Duplicate IPC handler registration (#851) | `windowLifecycle.spec.ts` - rapid IPC calls test | | Stream error handling (#880) | `streamEdgeCases.spec.ts` + `errorDisplay.spec.ts` | ## New Test Files (26 tests total) - **windowLifecycle.spec.ts** (6 tests): window operations, IPC stability under load - **ipcRobustness.spec.ts** (4 tests): concurrent IPC calls, state preservation - **streamEdgeCases.spec.ts** (6 tests): streaming during UI operations, error scenarios - **persistence.spec.ts** (4 tests): chat history, settings, mode persistence - **errorDisplay.spec.ts** (6 tests): error messages display, recovery flows ## Infrastructure Changes - **Error mock scenarios**: rate limit, server error, network error scenarios - **Stream timeline capture**: now handles `stream-error` events (previously only `stream-end`) - **CI matrix**: Linux (comprehensive, 47 tests) + macOS (window lifecycle, 6 tests) ## CI Configuration ```yaml matrix: include: - os: linux # Comprehensive E2E tests - os: macos # Window lifecycle tests only (platform-dependent) ``` _Generated with `mux`_
Generated with
muxSummary
Fixes "Object has been destroyed" crash when closing the window while background processes are still running.
Root Cause
The error occurred when:
Changes
Testing