Skip to content

fix(control): serde(flatten) breaks integer query parameters - #6

Merged
fylorn merged 1 commit into
mainfrom
dev
Sep 14, 2026
Merged

fylorn merged 1 commit into
mainfrom
dev

Conversation

@fylorn

@fylorn fylorn commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

/summary/buckets?from_ms=… returned 400: invalid type: string "1789300000000", expected i64.

#[serde(flatten)] deserializes through deserialize_any, and in a query string everything is a string — an i64 behind a flattened struct can never parse. Both endpoints added two commits ago did this.

Bad failure shape: fine without parameters, broken only when a time window is supplied — which the UI always does. The endpoints looked healthy in every hand check and would have left the chart permanently empty.

Unit tests can't see it; it needs a real query-string parse. The smoke script was hitting these endpoints without parameters, so it now hits four of them with a window — mutation-verified by restoring flatten, which turns the new check red.

1066 tests, 46 smoke checks.

🤖 Generated with Claude Code

`/summary/buckets?from_ms=…` returned 400:

    invalid type: string "1789300000000", expected i64

`#[serde(flatten)]` makes serde deserialize through `deserialize_any`,
and in a query string everything arrives as a string — so an `i64` field
behind a flattened struct can never parse. The endpoints I added two
commits ago both did this.

The failure shape is the bad kind: without parameters everything works,
and it only breaks **when a time window is supplied** — which the UI
always does. So the endpoints looked fine in every check I ran by hand
and would have been permanently empty in the chart they exist for.

Unit tests structurally cannot see this. It happens only when a request
actually passes through query-string deserialization, which is exactly
the class of failure `scripts/smoke.sh` exists for — and the smoke
script was hitting all these endpoints without parameters.

So it now hits four of them *with* a window, and that's the part worth
keeping: mutation-verified by putting `flatten` back, which turns the
new check red with the 400 in the output.

1066 tests, 46 smoke checks, clippy clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fylorn
fylorn merged commit fef4e99 into main Sep 14, 2026
3 checks passed
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