Repository navigation
fix(client): calls keep their middleware chain and deliver all their events - #127
Merged
kalaspuff merged 1 commit intoOct 31, 2026
Merged
Conversation
… events A middleware removed during a call made the next registered one not run for that call, as the chain indexed the live list: a call now runs the middleware registered when it starts. Only 1024 events of a call reached hooks before it returned; the rest waited for the next call. LoggingConfig.levels took the first matching pattern in dict order; an exact kind now wins over globs, and the longest matching glob over shorter ones. `from dynamoxy import *` failed without pydantic, since __all__ listed PydanticModel; it is listed only with pydantic installed. The slow threshold's docstring named `operation.slow` for `request.slow`. Fixes #96 Co-authored-by: Carl Oscar Aaro <[email protected]>
Contributor
Author
|
Stack of 10 pull requests, merged in this order with "Squash and merge":
|
This was referenced Oct 31, 2026
fix(models): numbers of union fields render as stored, and literals of plain enum members write
#126
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Five smaller client issues of #96:
remove()and thencall_nextmade the next registered middleware (a guard, say) not run for that call, and aremove()from another task changed calls in flight. A call now runs the middleware registered when it starts; additions and removals apply to calls that start afterwards.testing.capture_events()missed them (a put throttled 600 times captured 1024 of its 1200 request events). The drain now takes them all, in batches of 1024.LoggingConfig.levelsprecedence: the first matching pattern in the mapping's order won, so{"request.*": "debug", "request.gave_up": "error"}loggedrequest.gave_upat DEBUG. An exact kind now wins over globs, and of the matching globs the longest ("request.gave_*"over"request.*"over"*"); globs as long keep the mapping's order. Documented inLoggingConfig, the configuration reference and the observability guide.__all__listedPydanticModel, whose lazy import raisesImportErrorwithout pydantic, sofrom dynamoxy import *failed. It is now in__all__only when pydantic is installed.operation.slow; the event isrequest.slow.Verified with unit tests, each failing without the fix: a self-removing middleware and one added during a call, a put throttled 600 times on a client without the event task whose 600 retry and 600 throttle events all reach a hook, level precedence for exact kinds and globs in both orders, and
from dynamoxy import *in a subprocess with and without pydantic importable.make checkpasses.Fixes #96
Checklist
make checkpasses locally (lint, types, clippy, consistency, tests)Worth confirming
LoggingConfig.levels, the longest wins (ties: the first in the mapping), rather than only "exact kind beats globs" with dict order among globs.from dynamoxy import *still importsPydanticModeland so loads pydantic; without it, the star import leavesPydanticModelout instead of failing.fctl session
Note
Low risk. The changes are in the Python client's middleware chain, event drain, log-level lookup and star import, with tests; the main behavior shifts are that a call keeps the middleware it started with and that logging levels for overlapping globs can change.
What it does. Fixes five small client problems from #96. A call now runs the middleware that was registered when it started, so a middleware that removes itself no longer makes the next one skip that call. The drain after each call now takes all buffered events in batches of 1024 instead of at most 1024, so hooks and
capture_events()see every event before the call returns.LoggingConfig.levelsnow prefers an exact kind, then the longest matching glob, instead of the first match in dict order.PydanticModelis only listed in__all__when pydantic is installed, sofrom dynamoxy import *works without it, and a docstring namesrequest.slowinstead ofoperation.slow.Log level precedence. Configurations with overlapping globs in
LoggingConfig.levelscan log some events at a different level than before, since the longest glob now wins rather than the first one listed.fctl review's first look at
27ac8f5· 9 files, +167 −16 · Review agent settings