Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Prevent workspaces from getting stuck in 'Loading workspace...' state when errors occur during history replay.

Root cause

emitHistoricalEvents could fail before sending caught-up. If readPartial, replayStream, or replayInit threw an exception, the caught-up message would never be sent, leaving the frontend stuck in the loading state indefinitely with no indication of what went wrong.

Fix

Wrap replay logic in try/finally - the finally block guarantees caught-up is always sent regardless of what happens during replay. This is clear by construction rather than relying on error handling.


Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

Prevent workspaces from getting stuck in 'Loading workspace...' state
when errors occur during history replay.

Root cause: emitHistoricalEvents could fail before sending caught-up.
If readPartial, replayStream, or replayInit threw an exception, the
caught-up message would never be sent, leaving the frontend stuck.

Fix: Wrap replay logic in try/finally - the finally block guarantees
caught-up is always sent regardless of what happens during replay.

---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
@ammar-agent ammar-agent force-pushed the workspace-loading-znhk branch from 698bb2b to ad4bd58 Compare December 20, 2025 18:24
@ammario ammario merged commit b761b11 into main Dec 20, 2025
19 checks passed
@ammario ammario deleted the workspace-loading-znhk branch December 20, 2025 18:30
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