fix(core): flatten plain objects in the GET leftover-field query fallback#335
Open
sam-goodwin wants to merge 1 commit into
Open
fix(core): flatten plain objects in the GET leftover-field query fallback#335sam-goodwin wants to merge 1 commit into
sam-goodwin wants to merge 1 commit into
Conversation
…back The GET fallback in client.ts serializes non-annotated leftover fields with String(value), so object values went over the wire as `[object Object]` — same latent bug as the annotated query path fixed in the previous commit. Extract the fallback into buildExtraQueryParams and flatten plain objects to deepObject dot-notation; scalars, top-level arrays (legacy comma-join), and non-plain objects keep their existing serialization. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Install the packages built from this commit: @distilled.cloud/core bun add @distilled.cloud/core@https://pkg.distilled.cloud/core/ba4286e@distilled.cloud/aws bun add @distilled.cloud/aws@https://pkg.distilled.cloud/aws/ba4286e@distilled.cloud/axiom bun add @distilled.cloud/axiom@https://pkg.distilled.cloud/axiom/ba4286e@distilled.cloud/azure bun add @distilled.cloud/azure@https://pkg.distilled.cloud/azure/ba4286e@distilled.cloud/cloudflare bun add @distilled.cloud/cloudflare@https://pkg.distilled.cloud/cloudflare/ba4286e@distilled.cloud/coinbase bun add @distilled.cloud/coinbase@https://pkg.distilled.cloud/coinbase/ba4286e@distilled.cloud/expo-eas bun add @distilled.cloud/expo-eas@https://pkg.distilled.cloud/expo-eas/ba4286e@distilled.cloud/fly-io bun add @distilled.cloud/fly-io@https://pkg.distilled.cloud/fly-io/ba4286e@distilled.cloud/gcp bun add @distilled.cloud/gcp@https://pkg.distilled.cloud/gcp/ba4286e@distilled.cloud/kubernetes bun add @distilled.cloud/kubernetes@https://pkg.distilled.cloud/kubernetes/ba4286e@distilled.cloud/mongodb-atlas bun add @distilled.cloud/mongodb-atlas@https://pkg.distilled.cloud/mongodb-atlas/ba4286e@distilled.cloud/neon bun add @distilled.cloud/neon@https://pkg.distilled.cloud/neon/ba4286e@distilled.cloud/planetscale bun add @distilled.cloud/planetscale@https://pkg.distilled.cloud/planetscale/ba4286e@distilled.cloud/posthog bun add @distilled.cloud/posthog@https://pkg.distilled.cloud/posthog/ba4286e@distilled.cloud/prisma-postgres bun add @distilled.cloud/prisma-postgres@https://pkg.distilled.cloud/prisma-postgres/ba4286e@distilled.cloud/stripe bun add @distilled.cloud/stripe@https://pkg.distilled.cloud/stripe/ba4286e@distilled.cloud/supabase bun add @distilled.cloud/supabase@https://pkg.distilled.cloud/supabase/ba4286e@distilled.cloud/turso bun add @distilled.cloud/turso@https://pkg.distilled.cloud/turso/ba4286e@distilled.cloud/typesense bun add @distilled.cloud/typesense@https://pkg.distilled.cloud/typesense/ba4286e@distilled.cloud/workos bun add @distilled.cloud/workos@https://pkg.distilled.cloud/workos/ba4286e |
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.
Follow-up to #334 — same latent
[object Object]bug, but in the other query-serialization path: the GET fallback inclient.tsthat appends non-annotated leftover fields to the query string usedString(value)for everything.buildExtraQueryParamsintraits.ts(unit-testable) and reuses the deepObject flattening from fix(core): serialize struct query params as deepObject dot-notation #334.,-join on this path — deliberately preserved, unlike annotated params which send repeated pairs), and non-plain objects (Date, class instances) serialize exactly as before.No generated schema currently sends objects through this path, so this is hardening rather than a live-bug fix — but it closes the gap before some future generated operation trips over it silently.