clockworklabs / clockworklabs/SpacetimeDB

Make the auto-reconnect backoff configurable in the TypeScript SDK

Open
#5,526 1 comment 0 reactions 1 assignee View on GitHub

@JasonAtClockwork is already working on this.

Since Jul 20, 2026.

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

Description

The connection manager retries dropped connections with an exponential backoff that is fixed at module-level constants.
They are hard coded to start at 1000ms and maxes out at 30_000ms.

There is no way for an app to tune these. Apps that want faster recovery, or a gentler backoff, currently cannot change them. I for one require different values as my player base is 95% mobile browser in flaky connections areas.

Proposal: let the delays be set on the builder, e.g.

DbConnection.builder()
  .withUri(...)
  .withDatabaseName(...)
  .withReconnectOptions({ baseDelayMs: 500, maxDelayMs: 10_000 })

Open question for maintainers: field naming. The linked PR uses baseDelayMs / maxDelayMs to match the existing constant names, with baseDelayMs documented as the minimum (first-retry) delay. minDelayMs / maxDelayMs may read better for consumers. Happy to rename.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.