Skip to content

Fix type annotations and add missing logging statements #1135

@Jineshbansal

Description

@Jineshbansal

Description

This issue addresses code quality improvements:

  1. Fix type annotations in QUICErrorContext.__exit__
  2. Fix unnecessary return statement in Mplex.send_message
  3. Add missing logging statements in Mplex message handling

Motivation

  • Type safety: Current type annotations have errors (| None | None duplicate, Any instead of TracebackType)
  • Code clarity: Unnecessary return and # type: ignore comments reduce readability
  • Debuggability: Missing logging makes it hard to diagnose mplex stream issues in production

Current Implementation

QUIC exceptions (Line 354):

  • exc_type: type[BaseException] | None | None - redundant | None
  • exc_tb: Any - should be TracebackType | None

Mplex (Line 199):

  • return await self.write_to_stream(_bytes) # type: ignore
  • Unnecessary return since write_to_stream returns None

Mplex logging (Lines 280, 304, 310):

  • 3 TODO comments for missing logger.warning() calls
  • Logger already exists in file, just needs the calls added

Are you planning to do it yourself in a pull request ?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions