Skip to content

Conversation

@Jineshbansal
Copy link
Contributor

@Jineshbansal Jineshbansal commented Jan 17, 2026

Fixes #1135

What was wrong?

Several TODOs in the codebase related to type safety and logging:

  1. QUICErrorContext.__exit__ had incorrect type hints - exc_type had a duplicate | None and exc_tb was typed as Any instead of TracebackType | None

  2. Mplex.send_message had return type -> int but the underlying write_to_stream() returns None, requiring a # type: ignore to suppress the error

  3. Missing logging for edge cases in mplex message handling:

How was it fixed?

  • Added TracebackType import and corrected the __exit__ signature
  • Changed send_message return type to -> None and removed the unnecessary return statement (verified no callers use the return value)
  • Added logger.warning() calls for all three edge cases with descriptive messages

Testing

  • mypy passes on modified files
  • ruff linting passes
  • All mplex tests pass (32/32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix type annotations and add missing logging statements

1 participant