Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

When a window is recreated (e.g., clicking dock icon on macOS after closing all windows), createWindow() was trying to register the same IPC handlers again, causing the error:

Attempted to register a second handler for 'update:check'

Added a guard flag matching the pattern already used by ipcMain.register().

Generated with mux

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

1. Added guard to prevent duplicate updater IPC handler registration
   when createWindow() is called again after closing all windows.

2. Added try/catch error handling to the app.on('activate') handler
   so errors during window recreation are shown to the user instead
   of being silently swallowed.

_Generated with mux_
@ammar-agent ammar-agent force-pushed the user-reported-bug-fix branch from 5494456 to c527af6 Compare December 2, 2025 17:57
@ammario ammario merged commit 931f2ad into main Dec 2, 2025
13 checks passed
@ammario ammario deleted the user-reported-bug-fix branch December 2, 2025 18:11
ammario pushed a commit that referenced this pull request Dec 3, 2025
## 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`_
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