Repository navigation
fix: four-language client/server tweaks (dart, python, rust, ts) - #253
Merged
Merged
Conversation
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.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Four small, independent fixes — kept in separate commits for easy cherry-pick / revert.
pongoneof variable instead ofmsg.pongtungstenite::Message::BinarywantsBytesnotVec<u8>, so coerce prost'sencode()with.into()at every send site (client + server);Cargo.lockrefresh picks up tungstenite's new wasm-bindgen graphts-nodevianode --loader ts-node/esmin the run-*.sh scripts so they don't silently fall through totsxwhents-nodeisn't on PATH; matchesnpm run {client,server}Verified
cargo check --all-targetson 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).