open-webui/backend/open_webui/socket
Claude 7dc4d843fa
fix(stream): harden done-detection and isolate resume seq from persisted state
Two review findings:

1. Backend: the `done:True` detection in get_event_emitter called
   `.get('done')` on whatever `event_data['data']` happened to be. For
   most event types that's a dict, but some custom/pipeline events can
   legitimately emit non-dict inner payloads (list/string/None), which
   would raise AttributeError and break emission for that event. Now
   narrowed properly:

       inner = event_data.get('data') if isinstance(event_data, dict) else None
       if isinstance(inner, dict) and inner.get('done') is True:
           ...

2. Frontend: previously stored `message.lastSeq = incomingSeq` directly
   on the message object, which is part of `history` and gets serialized
   by saveChatHandler. That leaked transport-level resume metadata into
   persisted chat state. Moved bookkeeping into a component-local
   `resumeSeqByMessageId: Map<string, number>` so it stays in memory
   only and never touches the persisted schema. All reads/writes of
   lastSeq now go through the map.
2026-04-14 21:28:03 +00:00
..
main.py fix(stream): harden done-detection and isolate resume seq from persisted state 2026-04-14 21:28:03 +00:00
utils.py refac 2026-03-22 05:48:05 -05:00