fix: delete requests drop query params passed via {query: ...} - #1668
Merged
Conversation
WorkOS#delete takes the query object bare as its second argument,
unlike get/post/put which take { query: {...} }. Two callers passed
the wrapped shape, so URLSearchParams stringified the nested object
and the request carried ?query=[object Object] instead of the real
params:
- pipes.deleteUserConnectedAccount dropped organization_id
- vault.deleteObject dropped version_check
Pass the query objects bare, tighten WorkOS#delete's query parameter
from any to a flat record type so the wrapped shape no longer
typechecks, and assert the actual query strings in both specs.
Fixes #1667
Contributor
Greptile SummaryFixes DELETE query serialization by passing organization and version-check parameters directly to the shared client, narrows the accepted query type, and adds request-level regression assertions. Confidence Score: 5/5The PR appears safe to merge with no actionable correctness, compatibility, or security issues identified. The corrected callers now match the existing DELETE transport contract, supplied and omitted optional values serialize correctly, and all repository call sites remain compatible with the narrowed query type. Important Files Changed
Reviews (1): Last reviewed commit: "fix: pass query params to delete request..." | Re-trigger Greptile |
Contributor
|
This code comes from the autogenerator, but I patched the fix up there too. lgtm |
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.
Requested by Kat Brandt · Slack thread
Description
Before: calling
pipes.deleteUserConnectedAccount({ ..., organizationId })orvault.deleteObject({ id, versionCheck })sends?query=%5Bobject+Object%5Don the wire —organization_idandversion_checkare silently dropped, so the API never sees them.After: the real params are sent (
?organization_id=.../?version_check=...), and no junkqueryparam appears.How:
WorkOS#delete(path, query?)takes the query object bare, unlikeget/post/putwhich take{ query: {...} }. These two callers passed the wrapped shape, soURLSearchParamsstringified the nested object. This PR passes the query objects bare, tightensWorkOS#delete'squeryparameter fromanytoRecord<string, string | number | boolean | undefined>so the wrapped shape no longer typechecks, and adds spec assertions on the actual query string for both methods.Fixes #1667
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
Generated by Claude Code