Skip to content

fix: four-language client/server tweaks (dart, python, rust, ts) - #253

Merged
feuyeux merged 5 commits into
mainfrom
fix/four-language-tweaks
Oct 26, 2026
Merged

feuyeux merged 5 commits into
mainfrom
fix/four-language-tweaks

Conversation

@feuyeux

@feuyeux feuyeux commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Four small, independent fixes — kept in separate commits for easy cherry-pick / revert.

  • dart: send a full 64-bit random number (Dart VM is 64-bit native ints; the old 2^53-1 ceiling was a JS safe-int artifact that loses precision before the byte trip)
  • python: read the PONG timestamp from the local pong oneof variable instead of msg.pong
  • rust: tungstenite::Message::Binary wants Bytes not Vec<u8>, so coerce prost's encode() with .into() at every send site (client + server); Cargo.lock refresh picks up tungstenite's new wasm-bindgen graph
  • ts: invoke ts-node via node --loader ts-node/esm in the run-*.sh scripts so they don't silently fall through to tsx when ts-node isn't on PATH; matches npm run {client,server}

Verified cargo check --all-targets on the Rust commit (tungstenite 0.29.0 + tokio-tungstenite 0.29.0 + prost).

Skipped: hello-websocket-java/dependency-reduced-pom.xml (maven-shade-plugin build artifact; belongs in .gitignore, not in this PR).

feuyeux added 4 commits July 4, 2026 09:35
The previous value (9007199254740991 == 2^53 - 1) was chosen to match
JavaScript's Number.MAX_SAFE_INTEGER, but since the Dart VM is 64-bit
native ints we can send the full range. Construct a 64-bit random by
shifting a 31-bit top half and OR-ing a 32-bit bottom half, which
matches the u64 protobuf field on the wire.
Generated protobuf Python code exposes oneof variants as top-level
fields on the message instance, so the log line should read
pong.timestamp_ms (the local variable), not msg.pong.timestamp_ms.
tungstenite 0.29's Message::Binary expects Bytes, not Vec<u8>. Prost's
encode() returns Vec<u8>, so add an explicit .into() at every send site
in client and server. The Cargo.lock refresh picks up wasm-bindgen
0.2.126 and adds wit-bindgen 0.57.1 transitively from the new
tungstenite dep graph.
npx ts-node --esm silently falls back to tsx when ts-node isn't found
on PATH, which surprises users running the script outside an npm
context. Use 'node --loader ts-node/esm' so we go through the locally
installed ts-node in node_modules/.bin directly. This matches the
'npm run client'/'npm run server' scripts already in package.json.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@feuyeux
feuyeux merged commit f3c90f2 into main Oct 26, 2026
24 of 27 checks passed
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