open-webui/backend/open_webui/socket
Claude 572a5407bb
fix(stream): timeout xrange, clarify ack contract, stable sort seq-less
Three review findings:

- _stream_log_read now wraps xrange in asyncio.wait_for with the same
  RESUME_STREAM_REDIS_TIMEOUT_SEC used by writes. Returns empty on
  timeout so a degraded Redis can't hang resume-stream handlers.

- resume_stream docstring clarified: we always emit the replay ack
  when a message_id is present (including the Redis-down and
  empty-log cases), but auth-rejection branches (non-dict payload,
  missing session, missing message_id) intentionally drop silently —
  those callers either didn't raise a client fence at all or aren't
  legitimate sessions.

- Fence flush sort now stable for seq-less events: only orders when
  both sides have a numeric seq, otherwise preserves insertion order.
  Prevents graceful-degradation seq-less frames from being forced to
  the front and misordering state transitions like replace / done.
2026-04-14 22:26:56 +00:00
..
main.py fix(stream): timeout xrange, clarify ack contract, stable sort seq-less 2026-04-14 22:26:56 +00:00
utils.py refac 2026-03-22 05:48:05 -05:00