Unreal SDK: no way to set confirmed reads on the connection (Rust SDK has with_confirmed_reads)

Open Beginner friendly
#6,328 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp, unreal-engine

Research direction

Start with UDbConnectionBuilderBase::Build in sdks/unreal/src/SpacetimeDbSdk/Private/Connection/DbConnectionBuilder.cpp, using the Rust implementation in sdks/rust/src/websocket.rs and db_connection.rs as the behavioral reference. Add the option to both the C++ and Blueprint-facing builders, preserving omission when unset and serializing an explicit boolean when configured. Done means confirmed=true or confirmed=false is appended correctly and covered by the relevant Unreal SDK tests.

Written by the indexing model from the issue text.

Description

SpacetimeDB 2.12.0, Unreal SDK from sdks/unreal/src/SpacetimeDbSdk at v2.12.0, UE 5.8.3.

The Rust SDK lets the client choose the read mode explicitly: DbConnectionBuilder::with_confirmed_reads(bool) adds &confirmed=true|false to the subscribe URL (sdks/rust/src/websocket.rs, db_connection.rs). The Unreal SDK has no equivalent: UDbConnectionBuilderBase::Build (Private/Connection/DbConnectionBuilder.cpp) always builds

<uri>/v1/database/<name>/subscribe?compression=<Gzip|None>

so the mode is whatever the server default is for the protocol. With v2.bsatn.spacetimedb (which the Unreal SDK uses, Websocket.cpp) the server default is confirmed = true (client-api/src/routes/subscribe.rs, DEFAULT_CONFIRMED_READS), which is what we want, but we can't pin it from the client.

Why it matters for us: our game logic treats "reducer reply received" as "the transaction is durable" (inventory, trades, store purchases are only shown as done after the reply). If the default ever changes, or a different protocol version is negotiated, Unreal clients would silently switch to replies-before-fsync, while our Rust tools keep true explicitly.

Request: add WithConfirmedReads(bool) to UDbConnectionBuilder (and the Blueprint builder), appending &confirmed=true|false only when it was set, mirroring the Rust SDK. We can send a PR if that helps.

Workaround today: none without patching the SDK (the database name is interpolated into the path, so a query parameter can't be injected cleanly). We rely on the v2 default and check it in our load tests.

Dominant language
Rust
Stars
25.5k
Forks
1.1k
Avg merge
3d 5h
Merged PRs (30d)
70

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

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.

More from clockworklabs/SpacetimeDB

All issues in clockworklabs/SpacetimeDB

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.