mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
stream_bus.py: - _handle_message isolates Event.from_json in its own try/except; an undecodable payload (unknown EventType, bad UUID/timestamp, malformed JSON) is dead-lettered then ACKed instead of falling through to the broad except that only logged — a poison pill stayed pending forever and re-failed on every reclaim. (gap: stream-bus-malformed-event-poison-pill) - _reclaim_loop spawned alongside _listen_loop in start_listening (cancelled in disconnect). XREADGROUP '>' delivers only NEW messages, so a runtime handler failure left its message pending and unretried until a restart; the loop re-runs recover_pending every 60s so the idempotency-guarded replay actually fires. (gap: stream-bus-no-runtime-reclaim-loop) - _run_handler_guarded marker cleanup catches BaseException so a handler cancelled mid-flight (asyncio.CancelledError is BaseException-derived since 3.8) clears its SET-NX marker; otherwise the guard suppressed the very redelivery that would complete the work. (gap: stream-bus-cancelled- handler-keeps-idempotency-marker) TDD: 4 red->green tests in tests/unit/events/test_bus.py.