Commit 0dd7958
authored
fix(sendbox): cancel pending warmup when user submits (#2719)
When a user focuses the input, a 1s timer schedules a
`/api/conversations/{id}/warmup` request as a "pre-warm worker bootstrap"
hint. If the user submits inside that 1s window the timer still fires
later, racing the real `/messages` request on the same conversation.
The backend already single-flights `get_or_build_task`, so the race is
no longer corrupting state, but the extra request is pure waste.
In `sendMessageHandler`, clear any pending warmup timer and mark the
active conversation as already warmed. Covers all submit paths —
normal, side-question, and early-return cases — since the guard runs
before the branch switch.1 parent 69fc626 commit 0dd7958
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1141 | 1141 | | |
1142 | 1142 | | |
1143 | 1143 | | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1144 | 1156 | | |
1145 | 1157 | | |
1146 | 1158 | | |
| |||
0 commit comments