Skip to content

docs(uts): proxy supports both JSON and msgpack, not text frames only#496

Open
sacOO7 wants to merge 1 commit into
mainfrom
docs/proxy-supports-json-and-msgpack
Open

docs(uts): proxy supports both JSON and msgpack, not text frames only#496
sacOO7 wants to merge 1 commit into
mainfrom
docs/proxy-supports-json-and-msgpack

Conversation

@sacOO7

@sacOO7 sacOO7 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Corrects the integration-testing policy doc, which incorrectly stated that the test proxy is limited to JSON / text WebSocket frames.

uts-proxy v0.3.0 changed the proxy to determine a WebSocket message's encoding from the format query parameter (mirroring the real Ably server) instead of from the WebSocket frame type (text vs binary). The proxy can now decode, match, and act on both JSON and msgpack messages.

What was wrong

uts/docs/integration-testing.md claimed:

Proxy tests always use JSON. The proxy only supports text WebSocket frames, so proxy-based tests cannot use msgpack.

This assumption (frame opcode ⇒ encoding) was never how the Ably server behaves, and it broke proxy frame-inspection in a non-obvious way: SDKs that send JSON payloads over binary WebSocket frames (e.g. ably-java, even with useBinaryProtocol: false) had their client→server frames logged by the proxy as unparseable ({"_binary": true, "action": -1}). Any proxy rule or assertion matching on a client-sent protocol-message action therefore silently failed, even though the SDK was behaving correctly and the real server accepted the frames.

What changed

Updated the Protocol Variants section to reflect v0.3.0:

  • The proxy decodes by the format query parameter, matching the server.
  • Both JSON and msgpack are supported, including SDKs that send JSON over binary frames.
  • Proxy data-path tests follow the normal ## Protocol Variants convention; JSON is pinned only when the SDK under test does not implement msgpack (an SDK constraint, not a proxy one).

References

🤖 Generated with Claude Code

@github-actions github-actions Bot temporarily deployed to staging/pull/496 June 24, 2026 09:50 Inactive
@sacOO7 sacOO7 force-pushed the docs/proxy-supports-json-and-msgpack branch from b8c3684 to 7aa0bc8 Compare June 24, 2026 09:54
@sacOO7 sacOO7 requested a review from ttypic June 24, 2026 09:54
@github-actions github-actions Bot temporarily deployed to staging/pull/496 June 24, 2026 09:55 Inactive
uts-proxy v0.3.0 (ably/uts-proxy#4) derives a WebSocket message's encoding
from the `format` query parameter — matching the Ably server — rather than
from the WebSocket frame type. The proxy can therefore decode and match both
JSON and msgpack messages, including SDKs (e.g. ably-java) that send JSON
payloads over binary WebSocket frames.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant