Support factory terminal orchestration#297
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cad328c15
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const now = Date.now() | ||
| const pending = this.pendingUiCommands.filter((item) => item.expiresAt > now) | ||
| this.pendingUiCommands = [] | ||
| if (!pending.length) return |
There was a problem hiding this comment.
Preserve pending UI commands for concurrent reconnects
flushPendingUiCommands clears the global replay queue before sending to a specific target, so when multiple UI clients reconnect close together, the first authenticated client consumes all pending ui.command events and later clients miss them. This is observable after headless/orchestrated updates with no active UI: the first tab that sends hello gets replayed state changes, while a second tab opened moments later can remain out of sync on tabs/panes. Keep pending entries until expiry (or track per-connection delivery) instead of deleting the queue on first replay.
Useful? React with 👍 / 👎.
|
Superseded for local dev assembly by replacement PR #322. Reason: this PR comes from the external Glowforge/main branch and does not apply cleanly to current origin/main. The replacement PR ports only the intended factory terminal orchestration behavior onto current origin/main. Leaving this PR open as historical context unless Dan decides to close it. |
Summary
Testing