Skip to content

Follow the tightened script request bodies in gateway 0.7.0 - #102

Merged
bburda merged 1 commit into
mainfrom
fix/gateway-070-script-bodies
Sep 2, 2026
Merged

bburda merged 1 commit into
mainfrom
fix/gateway-070-script-bodies

Conversation

@bburda

@bburda bburda commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

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 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 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, so package-lock.json still records 0.6.0 and npm ci will fail until the release exists. Run npm install to refresh the lock once @selfpatch/ros2-medkit-client-ts 0.7.0 is out, then this is ready.


Issue


Type

  • Bug fix
  • New feature
  • Breaking change
  • Documentation only

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 typecheck and npm run build are clean. Before the change they failed with four errors in src/lib/api-dispatch.ts.
  • npm run lint is clean.
  • npm test passes 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 test against 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

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Linting passes (npm run lint)
  • Build succeeds (npm run build)
  • Docs were updated if behavior or public API changed

@bburda
bburda force-pushed the fix/gateway-070-script-bodies branch 3 times, most recently from cffc72c to 809f7cb Compare September 2, 2026 09:52
@bburda
bburda marked this pull request as ready for review September 2, 2026 09:57
@bburda bburda self-assigned this 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
bburda force-pushed the fix/gateway-070-script-bodies branch from 809f7cb to 9005c41 Compare September 2, 2026 11:23
@bburda
bburda merged commit 8c79cb5 into main Sep 2, 2026
6 checks passed
@bburda
bburda deleted the fix/gateway-070-script-bodies branch September 2, 2026 11:28
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.

Follow the tightened script request bodies in gateway 0.7.0

2 participants