Skip to content

chore(deps): bump tokio-tungstenite to 0.29 in the Rust SDK - #273

Merged
senamakel merged 1 commit into
mainfrom
build-time
Aug 8, 2026
Merged

senamakel merged 1 commit into
mainfrom
build-time

Conversation

@senamakel

@senamakel senamakel commented Aug 8, 2026 •

Copy link
Copy Markdown
Member

Bumps `tokio-tungstenite` 0.24 → 0.29 in `sdk/rust`, aligning with tinychannels (already on 0.29). In tinyhumansai/openhuman this removes the duplicate `tungstenite` 0.24 major and the `thiserror` 1.x + `thiserror-impl` 1.x proc-macro compile from the kernel dependency profile.

Code updated for the 0.29 API (`Message::Text`/`Binary` now wrap `Utf8Bytes`/`Bytes`). `cargo fmt --check` and a standalone `cargo check` pass in `sdk/rust`.

Companion openhuman PR bumps the gitlink alongside its own tokio-tungstenite bump.

Summary by CodeRabbit

  • Bug Fixes
    • Improved WebSocket text-message handling for more reliable message delivery.
    • Updated WebSocket support to maintain compatibility with the latest underlying networking improvements.

Unifies the WebSocket stack with the openhuman core, which pins 0.29;
the duplicate 0.24 major (plus its thiserror 1.x tail) drops out of the
kernel-floor graph. tungstenite 0.29's Message::Text wraps Utf8Bytes
rather than String, so the single send call site gains .into().

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@vercel

vercel Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tiny-place-website Ready Ready Preview Aug 8, 2026 3:58pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Rust SDK upgrades tokio-tungstenite from 0.24 to 0.29 and converts serialized text to the compatible WebSocket payload type before sending.

Changes

WebSocket compatibility

Layer / File(s) Summary
Dependency and text payload update
sdk/rust/Cargo.toml, sdk/rust/src/websocket.rs
The SDK upgrades tokio-tungstenite while retaining its features. Text-message sending converts serialized text into the required payload type.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: graycyrus, sanil-23

Poem

I’m a rabbit with a socket to tune,
Sending text beneath the moon.
New tungstenite hops in line,
Payloads fit and messages shine.
Hop, hop—WebSockets work fine!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: updating the Rust SDK dependency to tokio-tungstenite 0.29.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@sdk/rust/Cargo.toml`:
- Line 15: Update all five test-side Message::Text constructors and the
Message::Ping(Vec::new()) call to convert their existing values with .into() for
tokio-tungstenite 0.29’s Utf8Bytes and Bytes types. Regenerate the Cargo.lock
dependency entry so tokio-tungstenite is no longer pinned to 0.24.0.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7cc28564-6fe9-4a1a-af52-04b92720b12b

📥 Commits

Reviewing files that changed from the base of the PR and between d254505 and 2b5bb1d.

📒 Files selected for processing (2)
  • sdk/rust/Cargo.toml
  • sdk/rust/src/websocket.rs

Comment thread sdk/rust/Cargo.toml
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
tokio = { version = "1", features = ["time", "rt", "sync", "macros"] }
tokio-tungstenite = { version = "0.24", default-features = false, features = ["connect", "rustls-tls-webpki-roots"] }
tokio-tungstenite = { version = "0.29", default-features = false, features = ["connect", "rustls-tls-webpki-roots"] }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n 'Message::Text' sdk/rust --glob '*.rs'

Repository: tinyhumansai/tiny.place

Length of output: 813


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- dependency declarations and lock entries ---'
rg -n -C 2 'tokio-tungstenite|tungstenite' sdk/rust/Cargo.toml sdk/rust/Cargo.lock 2>/dev/null || true

printf '%s\n' '--- all Message::Text call sites ---'
rg -n -C 2 'Message::Text' sdk/rust --glob '*.rs'

printf '%s\n' '--- relevant test-module context ---'
sed -n '230,390p' sdk/rust/tests/websocket.rs
sed -n '500,540p' sdk/rust/tests/websocket.rs

printf '%s\n' '--- source-side context ---'
sed -n '235,270p' sdk/rust/src/websocket.rs
sed -n '330,350p' sdk/rust/src/websocket.rs

Repository: tinyhumansai/tiny.place

Length of output: 14192


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- all WebSocket Message constructors ---'
rg -n -C 1 'Message::[A-Za-z]+' sdk/rust --glob '*.rs'

printf '%s\n' '--- lockfile package ranges and workspace metadata ---'
sed -n '1,80p' sdk/rust/Cargo.toml
sed -n '1618,1640p' sdk/rust/Cargo.lock
sed -n '1717,1740p' sdk/rust/Cargo.lock

printf '%s\n' '--- repository state summary ---'
git diff --stat -- sdk/rust/Cargo.toml sdk/rust/Cargo.lock sdk/rust/tests/websocket.rs
git status --short -- sdk/rust/Cargo.toml sdk/rust/Cargo.lock sdk/rust/tests/websocket.rs

Repository: tinyhumansai/tiny.place

Length of output: 5633


🌐 Web query:

tokio-tungstenite 0.29 Message::Text Utf8Bytes Message::Ping Bytes API

💡 Result:

In tokio-tungstenite 0.29.0 (which relies on tungstenite 0.29.0), the Message enum API underwent a significant refactor to improve performance by utilizing the Bytes crate [1][2]. Key changes in the Message enum include: 1. Message::Text(Utf8Bytes): The Text variant now carries a Utf8Bytes payload instead of a String [3][4]. Utf8Bytes is a wrapper around Bytes that guarantees UTF-8 validity, allowing for more efficient, shared-memory handling of text messages [5]. You can create a Message::Text by passing any type that implements Into, such as a String or &str, using.into [3][4]. 2. Message::Ping(Bytes): The Ping variant (along with Pong and Binary) now directly uses the Bytes type [4][6]. This allows for cheap cloning of the payload, which is beneficial when sending the same message to multiple clients [1][5]. These changes were part of a broader effort to reduce allocations and align with higher-performance WebSocket implementations [5][7]. Because these types implement Into conversions, updating code from older versions typically involves replacing String or Vec usages with.into, which performs the necessary conversion to the new Bytes-backed types [3].

Citations:


Update all WebSocket message constructors and the lockfile.

tokio-tungstenite 0.29 uses Utf8Bytes for Message::Text and Bytes for Message::Ping. Update all five test-side Message::Text calls and the Message::Ping(Vec::new()) call to use .into(). Regenerate sdk/rust/Cargo.lock, which still pins version 0.24.0.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sdk/rust/Cargo.toml` at line 15, Update all five test-side Message::Text
constructors and the Message::Ping(Vec::new()) call to convert their existing
values with .into() for tokio-tungstenite 0.29’s Utf8Bytes and Bytes types.
Regenerate the Cargo.lock dependency entry so tokio-tungstenite is no longer
pinned to 0.24.0.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b5bb1da53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/rust/Cargo.toml
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
tokio = { version = "1", features = ["time", "rt", "sync", "macros"] }
tokio-tungstenite = { version = "0.24", default-features = false, features = ["connect", "rustls-tls-webpki-roots"] }
tokio-tungstenite = { version = "0.29", default-features = false, features = ["connect", "rustls-tls-webpki-roots"] }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Regenerate the committed Rust lockfile

When this checkout is used with --locked, the manifest now requires tokio-tungstenite 0.29 while the committed sdk/rust/Cargo.lock still selects tokio-tungstenite and tungstenite 0.24. Cargo documents --locked as asserting that the lockfile remains unchanged, so reproducible builds must fail rather than resolve the new dependency; ordinary builds instead silently dirty the checkout and leave the stated removal of the 0.24/thiserror 1.x dependency tail absent from the committed graph. Regenerate and commit Cargo.lock with this bump.

Useful? React with 👍 / 👎.

@senamakel
senamakel merged commit a28827b into main Aug 8, 2026
10 of 11 checks passed

This branch was successfully deployed

1 active deployment
Preview — 2b5bb1da Deployed Aug 8, 2026 by vercel[bot]
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