Skip to content

fix: catches SchemaError instead of ValidationError — validation failures unhandled #89

Description

@k-rister

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions