Skip to content

Validate local settings before queuing a batch - #1340

Open
edsonsims wants to merge 1 commit into
python-hyper:masterfrom
edsonsims:fix/validate-local-settings-batch
Open

edsonsims wants to merge 1 commit into
python-hyper:masterfrom
edsonsims:fix/validate-local-settings-batch

Conversation

@edsonsims

Copy link
Copy Markdown

A rejected update_settings() call can leave its valid prefix queued even though no SETTINGS frame was emitted. A later acknowledgement then applies an unsent value, contrary to the SETTINGS synchronization described in RFC 9113 section 6.5.3: in a paired client/server reproduction, one side changes its concurrent-stream limit to 3 while the peer still knows 100.

I validate the complete batch against the existing rules before queueing any values. This preserves the existing error type, code and message, connection-state error precedence, valid update ordering, and unknown setting codes. The change is limited to InvalidSettingsValueError validation failures.

Twelve new cases fail before the fix; all 16 regression/control cases pass afterward. The full suite passes 1,678 tests with 100% statement and branch coverage on Python 3.10, 3.12 and 3.13. Ruff, strict-bytes mypy, manifest/package checks, strict distribution checks and the documentation build pass. A fresh installed wheel also passes 12 paired-peer checks outside the checkout. No sockets or external service are needed for these tests.

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.

1 participant