enostr: enable TLS for the tokio websocket backend#1492
Conversation
Switching enostr's default to ewebsock's tokio backend (commit c726f46) left wss:// relay connections broken: ewebsock's `tls` feature only wires TLS into its *blocking* tungstenite backend, while the tokio backend connects via tokio-tungstenite, which had no TLS feature enabled. Every secure relay therefore failed with: relay wss://... error: "URL error: TLS support not compiled in" Enable tokio-tungstenite's `rustls-tls-webpki-roots` feature as part of `tokio-websocket` (matching the rustls + webpki-roots stack ewebsock already uses for its blocking backend, so no new TLS stack is added). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`let h = 32.0;` left the type ambiguous, so `.max()` on a value derived from it failed to compile on newer rustc (E0689, via the float_literal_f32_fallback future-compat change). Annotate `h` as f32 (egui geometry is all f32) to resolve it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe Misc Fixes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/notedeck_columns/src/ui/repost.rs (1)
118-120: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd rustdoc for
quote_icon.This function was modified in this PR, but it still has no doc comment. As per coding guidelines, "Ensure docstring coverage for any code added or modified".
🤖 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 `@crates/notedeck_columns/src/ui/repost.rs` around lines 118 - 120, Add a rustdoc comment for the quote_icon function in quote_icon so the modified public API is documented per coverage guidelines. Keep the doc comment brief and descriptive, explaining that it returns the widget used for the quote icon, and place it directly above quote_icon so it stays attached to the function even if the implementation changes.Source: Coding guidelines
🤖 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.
Nitpick comments:
In `@crates/notedeck_columns/src/ui/repost.rs`:
- Around line 118-120: Add a rustdoc comment for the quote_icon function in
quote_icon so the modified public API is documented per coverage guidelines.
Keep the doc comment brief and descriptive, explaining that it returns the
widget used for the quote icon, and place it directly above quote_icon so it
stays attached to the function even if the implementation changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 73eec11a-9b40-4ade-a039-23549583aa0a
📒 Files selected for processing (2)
crates/enostr/Cargo.tomlcrates/notedeck_columns/src/ui/repost.rs
|
thx |
Problem
After switching enostr's default to ewebsock's tokio websocket backend (commit c726f46, "chore(deps): pin negentropy transport prerequisites"), all
wss://relay connections fail:ewebsock'stlsfeature only enables TLS for its blocking tungstenite backend (tungstenite/rustls-tls-webpki-roots). The tokio backend connects viatokio-tungstenite, and no crate in the workspace enables a TLS feature on it — so the tokio path has no TLS connector and every secure relay is rejected at connect time. (NIP-11 metadata fetches still work because they use a separate HTTP client, which can mask the issue.)Fix
Enable
tokio-tungstenite'srustls-tls-webpki-rootsfeature as part of thetokio-websocketfeature. This matches the rustls + webpki-roots stackewebsockalready pulls in for its blocking backend, so no additional TLS stack is introduced.ewebsockpinstokio-tungsteniteto 0.24 (same as the workspace), so Cargo feature unification applies the TLS connector to ewebsock's tokio backend.Verification
Before: every
wss://relay →"TLS support not compiled in", blank timelines.After: TLS errors gone, relays connect (e.g. nos.lol, relay.coinos.io, relay.primal.net). Remaining failures are purely relay-side (nostr.wine 403 paid-relay auth, transient 502/503s).
Note
Also includes a small unrelated build fix:
columns: fix ambiguous float type in repost icon—let h = 32.0;was ambiguous and broke.max()on newer rustc (E0689 via thefloat_literal_f32_fallbackfuture-compat change). Happy to split this into its own PR if preferred.🤖 Generated with Claude Code
Summary by CodeRabbit