Bug Report
Multiple bugs found in roadblock.py:
1. Wrong exception type for schema validation (Critical)
Line 552: except jsonschema.exceptions.SchemaError should be ValidationError. SchemaError is raised when the schema itself is malformed, not when data fails validation. Actual validation failures propagate as unhandled exceptions.
Line 1838: Same wrong exception type in user message validation.
2. Duplicate unreachable condition
Line 574: elif not "recipient" in message["payload"] is identical to the condition on line 568 — this branch is unreachable dead code.
3. Wrong sender_id in message_build_custom
Line 1965: Passes the string "personal-stream-created" instead of self.my_id as the sender_id. Messages built with this function will have the wrong sender identity.
4. Missing backoff() on redis connection errors
Lines 1237-1242: No backoff() call on redis ConnectionError/TimeoutError in stream_add — creates a tight busy-loop that hammers the redis server when it's temporarily unavailable, unlike other redis operations that use backoff.
Bug Report
Multiple bugs found in
roadblock.py:1. Wrong exception type for schema validation (Critical)
Line 552:
except jsonschema.exceptions.SchemaErrorshould beValidationError.SchemaErroris raised when the schema itself is malformed, not when data fails validation. Actual validation failures propagate as unhandled exceptions.Line 1838: Same wrong exception type in user message validation.
2. Duplicate unreachable condition
Line 574:
elif not "recipient" in message["payload"]is identical to the condition on line 568 — this branch is unreachable dead code.3. Wrong
sender_idinmessage_build_customLine 1965: Passes the string
"personal-stream-created"instead ofself.my_idas the sender_id. Messages built with this function will have the wrong sender identity.4. Missing
backoff()on redis connection errorsLines 1237-1242: No
backoff()call on redisConnectionError/TimeoutErrorinstream_add— creates a tight busy-loop that hammers the redis server when it's temporarily unavailable, unlike other redis operations that use backoff.