Revert: stable client connectionId (PR #401)#403
Conversation
dimakis
left a comment
There was a problem hiding this comment.
Centaur Review
Found 2 issue(s).
packages/client/src/store.ts
Clean revert of PR #401 — no dangling references, no broken imports, and removed features are fully excised. Two minor gaps: stale sendError after reconnect-flush (pre-existing), and lost test coverage for SessionSseRegistry.add() reconnect behavior.
- 🔵 regressions (L375): After revert,
sendErrorset on failed send ('Not connected…') is only cleared when a new session starts viastartChat(). If the connection recovers and the queued message is flushed successfully, the stale error banner persists in the UI until the user starts another session. This was the pre-#401 behavior being restored, but worth noting as a known gap.[fixable]
server/__tests__/session-sse-registry.test.ts
Clean revert of PR #401 — no dangling references, no broken imports, and removed features are fully excised. Two minor gaps: stale sendError after reconnect-flush (pre-existing), and lost test coverage for SessionSseRegistry.add() reconnect behavior.
- 🔵 missing_tests: The entire
session-sse-registry.test.tsfile was deleted. It contained tests foradd(closing existing streams on reconnect) andremoveIfCurrent. WhileremoveIfCurrentwas removed, theaddreconnect behavior (closing stale streams) is still present in the implementation and now has no dedicated test coverage.[fixable]
| @@ -373,12 +373,6 @@ export function createMitzoStore(options: MitzoStoreOptions): StoreApi<MitzoStor | |||
| const sent = connection.send(msg); | |||
| if (!sent) { | |||
| set({ sendError: 'Not connected. Message will be sent when reconnected.' }); | |||
There was a problem hiding this comment.
🔵 regressions: After revert, sendError set on failed send ('Not connected…') is only cleared when a new session starts via startChat(). If the connection recovers and the queued message is flushed successfully, the stale error banner persists in the UI until the user starts another session. This was the pre-#401 behavior being restored, but worth noting as a known gap. [fixable]
Summary
feat(transport): stable client connectionId + POST failure resilience)Evidence from logs
connection-registryretrying missed events every 5s, missedCount climbing to 48conn-410546be...) cursor-resetting across two different sessionIds — one connection serving events for multiple sessionsTest plan
🤖 Generated with Claude Code