Repository navigation
fix(serialization-form): decode collection elements exactly once - #790
Merged
Vincent Biret (baywet) merged 2 commits intoOct 13, 2026
Merged
Vincent Biret (baywet) merged 2 commits into
Vincent Biret (baywet) merged 2 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation preserves collection boundaries and is well covered by regression tests.
0 open findings
What changed in this PR
Fixes form collection parsing so raw values are split before each element is decoded exactly once.
Changes:
- Corrects primitive and enum collection decoding.
- Adds encoded-value and writer/factory round-trip regressions.
| File | Description |
|---|---|
form_parse_node.py |
Splits raw collection values before decoding. |
test_form_parse_node.py |
Covers encoded and repeated collection values. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Vincent Biret (baywet)
approved these changes
Oct 13, 2026
Vincent Biret (baywet)
left a comment
Member
There was a problem hiding this comment.
Thanks for the contribution!
|
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.



Fixes #788.
Form collection readers corrupt literal plus signs, percent sequences and encoded commas. Writer-generated repeated fields can lose values and element boundaries.
The constructor decodes the node before collection readers split it. Primitive conversion then decodes again; enum child nodes also decode the already-decoded values. Split the retained raw collection value first, then decode each primitive or enum element once. Raw comma-separated lists, repeated-field order and duplicates remain supported.
Added direct encoded-value and real writer/factory round-trip regressions for primitive and enum collections, with plus/percent/comma, Unicode, space, repeated-value and raw CSV controls.
Validation: five new cases fail before the correction; all 63 form tests pass locally after it. YAPF, isort, Pylint and mypy pass. Pylint prints the existing suggestion-mode configuration diagnostic (exit 0), also reproduced on unchanged main and upstream CI.
Fork validation: run 38161550435, tested commit
22893db6a351c05335d9913ce3f61d633e4d5ae7, target79370e7ee8171a42abc828376dcbc331c27623e8, fork-only workflow revisionc517af083bb74af2a9877dc97eef434f8e014d70.All 46 jobs for this commit passed: eight packages across Python 3.10–3.14 with upstream formatting/import/Pylint/mypy/pytest commands, generated-code type checks on all five versions, and CodeQL. Each form run passed all 63 tests with no skips. CodeQL reported zero findings. Upstream import normalization is reproduced; the changed form package additionally needs no normalization. The validation workflow is separate from this PR.
The unchanged target passed upstream build run 37963997486; its form suite ran 55 tests successfully on each supported Python version.