Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

On macOS, clicking the dock icon during startup (while splash is visible and services are loading) fires the activate event. The handler was calling createWindow() without checking if services were initialized, causing an assertion failure:

AssertionError: Services must be loaded before creating window
at createWindow (src/desktop/main.ts:409:9)
at App.<anonymous> (src/desktop/main.ts:611:7)

Fix: Added services check to the activate handler condition. If services aren't ready, the handler does nothing and normal startup flow creates the window.


Generated with mux

On macOS, clicking the dock icon during startup (while splash is visible
and services are loading) fires the activate event. The handler was calling
createWindow() without checking if services were initialized, causing an
assertion failure.

Added services check to the condition - if services aren't ready, the
handler does nothing and normal startup flow creates the window.
ammar-agent added a commit that referenced this pull request Dec 10, 2025
Adds MUX_E2E_DELAY_SERVICES_MS env var to artificially delay service loading,
enabling tests that reproduce race conditions during startup.

New test emits the macOS 'activate' event (dock click) while services are
loading, verifying the app handles it gracefully without crashing.

This would have caught the bug fixed in #1064.
@ammario ammario merged commit 8e820b2 into main Dec 10, 2025
20 checks passed
@ammario ammario deleted the services-init-87e5 branch December 10, 2025 06:13
ammar-agent added a commit that referenced this pull request Dec 10, 2025
Adds MUX_E2E_DELAY_SERVICES_MS env var to artificially delay service loading,
enabling tests that reproduce race conditions during startup.

New test emits the macOS 'activate' event (dock click) while services are
loading, verifying the app handles it gracefully without crashing.

This would have caught the bug fixed in #1064.
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