Skip to content

Restore sorted(set()) instead of list(dict.fromkeys()) to sort keys in FieldList - #920

Merged
azmeuk merged 1 commit into
pallets-eco:mainfrom
azmeuk:fieldlist
May 8, 2026
Merged

azmeuk merged 1 commit into
pallets-eco:mainfrom
azmeuk:fieldlist

Conversation

@azmeuk

@azmeuk azmeuk commented May 8, 2026

Copy link
Copy Markdown
Member

Regression from 0458e58: switching to dict.fromkeys made entry order follow formdata key insertion. Combined with f50b52c's _compact_indices, HTTP clients that serialize form fields out of DOM order silently end up with swapped data. Restore the historical sort-by-index invariant — name="foo-N" is a numeric coordinate, formdata key order is not stable.

Regression from 0458e58: switching to dict.fromkeys made entry order
follow formdata key insertion. Combined with f50b52c's _compact_indices,
HTTP clients that serialize form fields out of DOM order silently end up
with swapped data. Restore the historical sort-by-index invariant —
name="foo-N" is a numeric coordinate, formdata key order is not stable.
@azmeuk azmeuk added the bug Unexpected behavior label May 8, 2026
@azmeuk
azmeuk merged commit cfa5328 into pallets-eco:main May 8, 2026
17 checks passed
@azmeuk
azmeuk deleted the fieldlist branch May 8, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior

Development

Successfully merging this pull request may close these issues.

1 participant