Follow the tightened script request bodies in gateway 0.7.0 - #102
Merged
Merged
Conversation
bburda
force-pushed
the
fix/gateway-070-script-bodies
branch
3 times, most recently
from
September 2, 2026 09:52
cffc72c to
809f7cb
Compare
bburda
marked this pull request as ready for review
September 2, 2026 09:57
mfaferek93
approved these changes
Sep 2, 2026
The gateway now describes both script request bodies instead of leaving them open. The upload body declares a required `file` part with optional `metadata`; the execution body is ScriptExecutionRequest, with `execution_type` required. Two casts in api-dispatch.ts existed only because those bodies used to be untyped, and they stop compiling against the 0.7.0 client. The execution cast is gone. StartScriptExecutionRequest already has the same shape as the generated ScriptExecutionRequest, so the body passes through and a future divergence between the two becomes a type error here. The upload keeps a cast, because FormData is a DOM interface and can never be assignable to a generated object type, but it now names the declared body instead of Record<string, unknown>, so a change to the parts is caught at compile time rather than as a 400 at runtime. No request path changed between 0.6.0 and 0.7.0, so nothing else is affected. The client pin moves to ^0.7.0 and the package version follows it.
bburda
force-pushed
the
fix/gateway-070-script-bodies
branch
from
September 2, 2026 11:23
809f7cb to
9005c41
Compare
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.
Pull Request
Summary
The gateway 0.7.0 spec describes both script request bodies instead of leaving them open. The upload body declares a required
filepart with optionalmetadata; the execution body isScriptExecutionRequest, withexecution_typerequired. Two casts inapi-dispatch.tsexisted only because those bodies used to be untyped, and they stop compiling against the 0.7.0 client.The execution cast is gone.
StartScriptExecutionRequestalready has the same shape as the generatedScriptExecutionRequest, so the body passes straight through, and if the two ever drift apart it becomes a type error here.The upload keeps a cast, because FormData is a DOM interface and can never be assignable to a generated object type. It now names the declared body type instead of
Record<string, unknown>, so a change to the parts is caught at compile time rather than as a 400 at runtime.No request path changed between 0.6.0 and 0.7.0, so nothing else is affected.
The package version moves to 0.7.0 alongside the client pin.
This is a draft on purpose. The client pin moves to
^0.7.0, which is not published yet, sopackage-lock.jsonstill records 0.6.0 andnpm ciwill fail until the release exists. Runnpm installto refresh the lock once@selfpatch/ros2-medkit-client-ts0.7.0 is out, then this is ready.Issue
Type
Testing
Verified against a gateway built from the 0.7.0 release branch, with the client regenerated from that gateway's exported spec and installed locally.
npm run typecheckandnpm run buildare clean. Before the change they failed with four errors insrc/lib/api-dispatch.ts.npm run lintis clean.npm testpasses 736 tests in 36 files. Worth noting that it also passed before the change, because vitest does not typecheck, so the unit suite is not what catches this.npx playwright testagainst the live 0.7.0 gateway passes 21 tests, 3 skipped (the rosbag project needs its own stack). This covers the upload, run and delete path and the execution path, which are the lines the casts sit on.Checklist
npm run lint)npm run build)