Skip to content

Conversation

bsbodden
Copy link
Contributor

Issue #83: Command with resume argument failing in v0.1.0

Users reported warning 'Ignoring invalid packet type <class 'dict'> in pending sends' when using Command(resume={'interrupt_id': {'some': 'result'}}) after upgrading from 0.0.8 to 0.1.0.

Root cause: Type annotation mismatch in _load_pending_sends methods. They were annotated as returning List[Tuple[str, bytes]] but Redis JSON actually returns strings for blob data, not bytes, causing List[Tuple[str, Union[str, bytes]]].

This type mismatch caused the warning when Command(resume) tried to process pending sends containing dict values through the TASKS channel.

Changes:

  • Updated return type hints for _load_pending_sends methods in both sync and async
  • Updated _load_pending_sends_with_registry_check type hints
  • Updated _abatch_load_pending_sends and local variable annotations in async
  • Added test that simulates Command(resume) scenario and verifies no warning
  • Added test for type compatibility with Redis JSON string blobs

The fix ensures Command(resume) works without warnings while maintaining backward compatibility with code that passes bytes.

@bsbodden bsbodden self-assigned this Aug 11, 2025
@bsbodden bsbodden added the bug Something isn't working label Aug 11, 2025
)

Issue #83: Command with resume argument failing in v0.1.0

Users reported warning 'Ignoring invalid packet type <class 'dict'> in pending sends'
when using Command(resume={'interrupt_id': {'some': 'result'}}) after upgrading
from 0.0.8 to 0.1.0.

Root cause: Type annotation mismatch in _load_pending_sends methods. They were
annotated as returning List[Tuple[str, bytes]] but Redis JSON actually returns
strings for blob data, not bytes, causing List[Tuple[str, Union[str, bytes]]].

This type mismatch caused the warning when Command(resume) tried to process
pending sends containing dict values through the TASKS channel.

Changes:
- Updated return type hints for _load_pending_sends methods in both sync and async
- Updated _load_pending_sends_with_registry_check type hints
- Updated _abatch_load_pending_sends and local variable annotations in async
- Added test that simulates Command(resume) scenario and verifies no warning
- Added test for type compatibility with Redis JSON string blobs

The fix ensures Command(resume) works without warnings while maintaining
backward compatibility with code that passes bytes.
@bsbodden bsbodden merged commit b1eb0b6 into main Aug 12, 2025
19 checks passed
@bsbodden bsbodden deleted the bsb/issue-83 branch August 12, 2025 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant