Skip to content

fix(client): flatten skipReadyWait option#4955

Merged
NathanFlurry merged 1 commit intomainfrom
skip-ready-wait/flatten-client-options
May 5, 2026
Merged

fix(client): flatten skipReadyWait option#4955
NathanFlurry merged 1 commit intomainfrom
skip-ready-wait/flatten-client-options

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

@NathanFlurry NathanFlurry commented May 4, 2026

Stack Context

This stack updates the RivetKit client API and docs around gateway readiness bypass behavior.

Why?

The skip ready wait option was documented as a nested per-call gateway option. This PR flattens the per-call shape to skipReadyWait: true and updates docs, examples, and tests to match.

Copy link
Copy Markdown
Member Author

NathanFlurry commented May 4, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@NathanFlurry NathanFlurry force-pushed the skip-ready-wait/flatten-client-options branch from 1cae221 to eb18651 Compare May 4, 2026 15:36
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 4, 2026

PR Review: fix(client): flatten skipReadyWait option

Summary: This PR renames bypassConnectable to skipReadyWait throughout the stack and flattens the per-call option from nested gateway.skipReadyWait to top-level skipReadyWait. The change touches Rust guard routing, TypeScript client options, wire headers/protocols, docs, and tests.


Positives

  • Better naming. bypass_connectable was an internal implementation detail; skip_ready_wait describes the user-visible behavior accurately.
  • Improved header validation. The old code treated header presence as true; the new read_skip_ready_wait_header parses true/false/1/0 and returns a typed guard.invalid_header error for anything else.
  • TODO resolved. The ParsedActorPath::Direct arm previously hardcoded false with a // TODO: comment. It now calls read_skip_ready_wait_for_path_based correctly.
  • isPathOrQuery fix. canUseDirectBypassPath used strict equality and would miss /connect?room=lobby. The new helper handles query-string paths.
  • Token in WebSocket protocols. buildWebSocketProtocols had an unused _runConfig param; the fix threads the token into protocols when a target is present. A new test exercises this.
  • Comprehensive rename. Wire headers, WebSocket subprotocols, query params, TypeScript consts, Rust field names, docs, and examples are all updated consistently.

Issues

1. Missing trailing newline in artifact file

engine/artifacts/errors/guard.invalid_header.json is missing a trailing newline. Other files in that directory end with a newline.

2. Breaking wire-protocol change

The HTTP header, WebSocket subprotocol, and query param are all renamed. Old clients talking to new servers (or vice versa) will silently lose the flag. If mixed deployments are possible, reading both names in the guard during a transitional window would be safer.

3. Redundant type aliases

After the change, ActorConnectOptions, ActorWebSocketOptions, and ActorGatewayOptions are all structurally identical. Worth a conscious decision on whether distinct names add clarity.

4. ActorFetchInit extra key in RequestInit contexts

The new type ActorFetchInit = RequestInit & ActorGatewayOptions is correct for destructuring in actor-handle.ts. However, consumers passing an ActorFetchInit where a plain RequestInit is expected will carry an extra skipReadyWait key. Mostly harmless but worth noting.


Nits

  • parse_skip_ready_wait_bool in pegboard_gateway/mod.rs overlaps with the parse_query_bool helper inside extract_rvt_params. Consider consolidating.
  • If .agent/notes/driver-test-progress.md tracked the old test file gateway-bypass-client.test.ts, update it to match the renamed file.

Verdict

Clean and well-executed. Fix the missing trailing newline in the JSON artifact, and add a note in the PR description about the wire-protocol break for operators doing rolling deployments.

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