fix(webui): stop SSE reload retry storms - #7268
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe SSE hook now persists connection identity across reloads, assigns fresh identity to duplicated tabs, sends connection ID and generation per request, and updates stream watchdog handling around validated responses and reconnects. Tests cover persistence, validation, rotation, and rejected handshakes. ChangesSSE identity and transport
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Browser
participant sessionStorage
participant useSSE
participant SSEServer
Browser->>sessionStorage: Read persisted connection state
useSSE->>useSSE: Validate navigation and generation
useSSE->>sessionStorage: Persist connection ID and generation
useSSE->>SSEServer: Request stream with connection ID and generation
SSEServer-->>useSSE: Return validated event-stream response
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🚅 Deployed to the ironclaw-pr-7268 environment in ironclaw-ci-preview
|
🔎 Review · PR #7268
Execution result is invalid The structured result could not be verified. Automatic · PR opened · attempt 1 of 3 · failed after 2m 3s Failure details
|
Summary
event-source-plusretry ownership.Change Type
Linked Issue
None — reproduced from an RC deployment report.
Validation
cargo fmt --all -- --check— Not applicable: no Rust files changed.cargo clippy --all --benches --tests --examples --all-features -- -D warnings— Not applicable: no Rust files changed.cargo build— Not applicable: frontend-only change; the production Vite build ran directly.corepack pnpm test(126 files, 1,093 tests).cargo test --features integration— Not applicable: no database-backed behavior changed.review-prorpr-shepherd --fixwas run before requesting review.Additional gates:
corepack pnpm lint,corepack pnpm buildwith bundle budgets,git diff --check, eight focused review lanes, and a strict maintainability review.Test Strategy
User behavior: Repeatedly refreshing WebChat no longer consumes independent per-user SSE slots, and a 429 handshake no longer leaves a competing activity-watchdog reconnect armed.
Risk areas:
Tests added or updated:
frontend/src/pages/chat/lib/useSSE.test.tsWhat the tests prove:
connection_idand increments its generation.Commands run:
corepack pnpm exec vitest run src/pages/chat/lib/useSSE.test.tscorepack pnpm testcorepack pnpm lintcorepack pnpm buildgit diff --checkSecurity Impact
None. Persisted values are a bounded opaque connection ID and monotonic generation only; bearer credentials remain in the
Authorizationheader.Reborn Trust-Boundary Checklist
N/A: frontend transport lifecycle only; no trust-bearing types, prompts, hashes, permissions, runtime variants, serialization contracts, or sandbox boundaries changed. Persisted reload state is shape-validated and bounded before use.
Database Impact
None.
Blast Radius
WebChat SSE connection lifecycle only. Fresh tabs remain independent; SPA thread changes retain one loaded-document identity; server concurrency and request-rate policies are unchanged.
Rollback Plan
Revert commit
2805a466ac. No schema, migration, or server compatibility rollback is required.Review Follow-Through
One review finding identified the safe-integer generation boundary. The implementation now rotates identity and generation atomically in the per-request query, with dedicated regression coverage. Final review lanes were clean.
Review track: B (browser-facing bug fix)