Skip to content

Client: removing middleware mid-call, events beyond 1024 per call, LoggingConfig precedence, star import #96

Closed

Description

@fctl-sh

Priority: low. Smaller client issues:

  • Removing a middleware during a call skips the next one (client.py, _chain indexes the live _middleware list): a one-shot middleware that calls its remove() and then call_next makes the next registered middleware not run for that call (a guard could be skipped); a remove() from another task affects calls in flight. Snapshot the chain when the call starts.
  • Only 1024 events are delivered after each call (client.py, drain_events(1024)): the rest wait for the pump or the next call, contradicting "Events of a call reach hooks before the call returns", and capture_events misses them (a put throttled 600 times captured 1024 of 1200 events).
  • LoggingConfig.levels: the first matching pattern in dict order wins (events.py): with {"request.*": "debug", "request.gave_up": "error"}, request.gave_up is logged at DEBUG. An exact kind should beat a glob, or the precedence should be documented.
  • from dynamoxy import * fails without pydantic: __all__ lists PydanticModel, whose lazy __getattr__ raises ImportError; with pydantic installed, the star import loads it eagerly.
  • A docstring names the wrong event: crates/dynamoxy-core/src/config.rs says the slow threshold emits operation.slow; the event is request.slow.

Found in a review of the library for bugs (fctl session); the fixes that fit in its ten pull requests are #61 to #65, #67 to #70 and #72.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions