Wire the 409 merge-retry transport into the chat (the one-line seam)
chat.tsx now uses createChatTransport(chatId): a send racing the wake pipeline waits for the in-flight turn, merges onto the fresh server record, and re-POSTs instead of surfacing the 409 banner. Also fixes the transport's import to the core barrel (shell import law). The optional "server-ahead heal" line in the jobs poller was considered and skipped: the racing turn IS the wake turn, whose completion flips the job to done within a poll tick or two — the existing settle-triggered syncFromServer already heals the post-merge gap within ~1-2s. The extra record fetch on every poll tick would double poll traffic for a path the settle sync already covers.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
* a future "server-ahead" heal in the poller). Rare path; self-heals.
|
||||
*/
|
||||
import { DefaultChatTransport } from "ai";
|
||||
import type { TeacherUIMessage } from "@/src/core/ui-message";
|
||||
import type { TeacherUIMessage } from "@/src/core";
|
||||
|
||||
/** How often to poll turnInFlight while the racing turn runs. */
|
||||
const TURN_POLL_MS = 500;
|
||||
|
||||
Reference in New Issue
Block a user