clockworklabs / clockworklabs/SpacetimeDB

Rust SDK hides websocket error

Open
#2,889 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

Currently if a server disconnects a client directly or blocks the connection from happening you can not get the state out of it in the sdk. You only can get a log messages out of it.

WARN spacetimedb_sdk::websocket: Error reading message from read WebSocket stream: Protocol(ResetWithoutClosingHandshake)

So it would be nice to get a callback on on_connect_error for it or if there is an function to get the error of why the connection is not active. So there is a better way to handle the error and if you should even try a reconnect depending on why your connection is not active.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Rust SDK's WebSocket read-stream handling and the proposed on_connect_error entry point. Determine how server disconnects and blocked connections are currently surfaced, then verify that callers can observe the failure reason and decide whether to reconnect.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.