clockworklabs / clockworklabs/SpacetimeDB
Make the auto-reconnect backoff configurable in the TypeScript SDK
@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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.