Recover chat sends after fetch failures#308
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com>
|
Claude finished @lewtun's task in 3m 26s —— View job Review: Recover chat sends after fetch failures1 P0, 1 P1 — the recovery flow is well-structured (probe → reconnect-live → hydrate → finish), aborts and HTTP/provider errors correctly keep their existing paths, and the optimistic-message dedup via P0 — Unrecoverable failure silently drops the user's message from the UI
const setMsgs = chatActionsRef.current.setMessages;
if (setMsgs && uiMsgs.length > 0) {
setMsgs(uiMsgs); // <-- drops the optimistic user message
saveMessages(sessionId, uiMsgs);
}In the genuine-failure case (POST never reached the backend → This diverges from the established guard the repo already uses for exactly this overwrite — the 3s poller at const currentCount = chatActionsRef.current.messages.length;
if (msgs.length > currentCount || currentCount === 0) {
chat.setMessages(msgs); // only overwrite when backend has >= local
saveMessages(sessionId, msgs);
}That same guard fixes this: when recovery fails, Suggested fix: gate the P1 —
|
Co-authored-by: OpenAI Codex <codex@openai.com>
|
Claude finished @lewtun's task in 1m 15s —— View job Re-review: Recover chat sends after fetch failuresNo blocking issues. Both findings from the prior review were addressed in
The P2 notes from the prior review (redundant |
|
Addressed the review in 6510d69:
Checks:
|
|
Claude finished @lewtun's task in 34s —— View job Re-review: Recover chat sends after fetch failuresNo blocking issues. The latest push (
The P2 notes from the earlier review (redundant |
Co-authored-by: OpenAI Codex <codex@openai.com>
|
Claude finished @lewtun's task in 2m 30s —— View job Re-review: Recover chat sends after fetch failuresNo blocking issues. The latest push ( P2 (resolved) — The redundant I traced one behavior change introduced by this commit and confirmed it is correct, not a regression:
The prior P0 (dropped optimistic message) and P1 ( |
|
Addressed the redundant-fetch P2 in 05d4423:
Checks repeated:
Browser sanity check: local app reloads at http://127.0.0.1:5173/ with title |
Summary
Checks