mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-16 23:43:03 +00:00
fix(stream): per-envelope try/catch in replay loop
A throw in a single replayed envelope used to abort the entire onResumeStreamReplay loop, skipping all subsequent envelopes in the batch. Fence still cleared via finally, so the loss was silent. Matches the per-event error handling already in clearResumeFence.
This commit is contained in:
parent
c1c971ee47
commit
e20c857e0f
1 changed files with 8 additions and 1 deletions
|
|
@ -768,7 +768,14 @@
|
|||
for (const envelope of envelopes) {
|
||||
if (!envelope || typeof envelope !== 'object') continue;
|
||||
envelope._replayed = true;
|
||||
await chatEventHandler(envelope);
|
||||
try {
|
||||
await chatEventHandler(envelope);
|
||||
} catch (e) {
|
||||
// Per-envelope catch so one bad frame doesn't abort
|
||||
// the rest of the replay batch and silently lose the
|
||||
// envelopes that come after it.
|
||||
console.error('resume replay envelope error', e);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
const current = resumeActiveRequestIdByMessageId.get(messageId);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue