mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-16 23:43:03 +00:00
- resume_stream now short-circuits when ENABLE_REALTIME_CHAT_SAVE is on, mirroring the write-side gate in _stream_seq_allocate. Without this, stale logs written before the flag was flipped (or by a mixed-version peer) could still replay on top of DB-backed content and double-apply. - Added optional chat-ownership check: if the client sends chat_id, we validate via Chats.get_chat_by_id_and_user_id and reject on failure. Defense-in-depth alongside the user-scoped key. Fails OPEN when the chat lookup errors or chat_id is absent, so we don't regress the "stub not persisted in DB" refresh scenario that motivated removing the earlier stricter check. Frontend updated to include chat_id in the resume payload. - Client now requires an exact request_id match when expected is set. A reply without a request_id used to fall through and clear the active fence, which could prematurely flush a newer in-flight request's buffer. Now rejects both missing and mismatched. Deferred: suggestion to prune resumeSeqByMessageId on per-message terminal events. That was intentionally removed two rounds ago because the same pattern caused continuation-reuses-message_id to replay duplicate content. The memory footprint is int-per- message bounded by chat size and is cleared at chat/navigation boundaries — this is a deliberate trade-off, not an oversight. |
||
|---|---|---|
| .. | ||
| data | ||
| internal | ||
| migrations | ||
| models | ||
| retrieval | ||
| routers | ||
| socket | ||
| static | ||
| storage | ||
| test | ||
| tools | ||
| utils | ||
| __init__.py | ||
| alembic.ini | ||
| config.py | ||
| constants.py | ||
| env.py | ||
| functions.py | ||
| main.py | ||
| tasks.py | ||