Skip to content

Releases

Release v2.16.3

Choose a tag to compare

@rekhoff rekhoff released this 24 Nov 20:37
d0413bd

Improvements

TypeScript SDK: much lower client cache memory use

The client cache previously built every index of every subscribed table eagerly, which could use several times more heap than the rows themselves and run memory-constrained Node processes out of memory at startup. Indexes are now built on their first lookup, index nodes allocate child maps only when needed, and unique single-column indexes use a flat map. In one measured client (about 197k rows across 25 tables and 100 indexes), cache heap after the initial subscription dropped from 324 MB to 85 MB, and the initial fill went from roughly 1 to 1.5 seconds to under 250 ms.

find and filter keep their signatures and results. The first lookup on a given index pays a one-time build cost.

(#6614)

Out-of-energy reducer aborts now appear in database logs

When a reducer is aborted for exceeding its CPU budget, the reason was previously only visible in host logs. The error is now written to the database logs, where module developers can see it.

(#6612)

Bug Fixes

Rust SDK: on_disconnect now fires when a call is queued after disconnecting

Calling a reducer or procedure right after disconnect(), or losing the WebSocket sender unexpectedly, previously ended the connection silently without invoking on_disconnect callbacks. In the sender-loss case, the SDK could also panic and poison its internal send-channel lock. The SDK now routes these cases through normal connection teardown, so on_disconnect is reliably called and no panic occurs.

(#6329)

Fixed snapshot verification failing on freed page slots

Verifying a snapshot that contained a freed page slot failed the object lookup against the previous snapshot, which prevented snapshot archival from advancing. Freed slots are now skipped during verification.

(#6659)

Fixed databases failing to load when over the memory budget

Databases whose resident memory footprint exceeded the configured limit could fail to finish loading. The memory budget is now suspended through snapshot restoration, replay, and index rebuilding, then re-enforced afterward. Databases that remain over budget still reject new ordinary allocations.

(#6658)

Build against OpenSSL 4

Updated the openssl crate so SpacetimeDB builds from source on systems that ship OpenSSL 4.

(#6583)

What's Changed

  • Fixed the Rust SDK skipping on_disconnect when a mutation is queued after disconnect in #6329
  • Fixed snapshot verification failing on freed page slots, which blocked snapshot archival, in #6659
  • Fixed databases failing to load when over the configured memory budget in #6658
  • Bumped the openssl crate to support OpenSSL 4 in #6583
  • Built TypeScript SDK cache indexes on first lookup with a flat map for unique single-column indexes in #6614
  • Added the out-of-energy error to database logs in #6612
  • Fixed the Stripe, PostHog and Auth packages emitting incompatible types on TypeScript SDK 2.12 in #6681

Full public changelog: v2.16.1...v2.16.3

Release v2.16.1

Choose a tag to compare

@rekhoff rekhoff released this 20 Nov 04:51
8932a5a

Features

🚀 Tiered storage: your database is no longer limited by RAM 🚀

Until now, every SpacetimeDB database has had a hard limit on database size: all of its data had to fit in memory.

As of today, that limit is gone. With tiered storage, a table's data can be stored in remote object storage and cached across memory, local disk, and remote storage in a tiered structure. SpacetimeDB keeps your hot data in memory and moves colder data to cheaper tiers, so your database can grow far beyond the RAM of any single machine.

Turning it on

Tiered storage is opt-in per table in this release, so existing modules keep exactly the performance they have today. To opt a table in, give it a cache policy:

Policy What it means
required_in_memory Default. The whole table stays in memory, as before.
required_on_disk Data can leave memory but always stays on local disk.
no_requirement Full tiered storage. Let the host decide where to cache data.

Rust

#[spacetimedb::table(accessor = chat_message, public, cache_policy = no_requirement)]
pub struct ChatMessage {
    #[primary_key]
    #[auto_inc]
    id: u64,
    sender: Identity,
    text: String,
}

TypeScript

const chatMessage = table(
  { name: 'chat_message', public: true, cachePolicy: 'no_requirement' },
  {
    id: t.u64().primaryKey().autoInc(),
    sender: t.identity(),
    text: t.string(),
  }
);

C#

[SpacetimeDB.Table(Accessor = "ChatMessage", Public = true,
    CachePolicy = SpacetimeDB.TableCachePolicy.NoRequirement)]
public partial struct ChatMessage
{
    [SpacetimeDB.PrimaryKey, SpacetimeDB.AutoInc]
    public ulong Id;
    public Identity Sender;
    public string Text;
}

You can change the policy on an existing table too: update the attribute and republish, and the migration is handled for you.

This feature is great for use cases such as message history, event logs, match replays, inventories, and any large table where only a small slice is hot at once.

⚠️⚠️⚠️ Heads up: in the next major version (3.0), no_requirement will become the default. To keep the current all-in-memory behavior for a table after that, set required_in_memory explicitly.

⚠️⚠️⚠️ Heads up: As of this update, all Maincloud databases now have a default limit of 24 GiB of resident memory. If you see the error Database resident memory budget exceeded (limit: 24.0 GiB). while inserting into your database, you can either delete data or opt-in to tiered storage.

What happens to cold data during a transaction?

When a reducer touches data that has been moved out of memory, SpacetimeDB brings it back into memory automatically. Your code will continue to work unchanged. You call ctx.db.chat_message.id.find(42) the same way whether that row is in memory, on disk, or in remote storage.

The tricky part is the commit. Fetching data from disk or remote storage can fail, for example because of a network error. If that happens SpacetimeDB must abort the transactions.

In order to ensure atomicity, SpacetimeDB commits in two steps:

  1. Gather. It loads everything the transaction will modify into memory and locks it there, so nothing can be moved back out while the commit is in progress. If loading fails here, nothing has been written yet and the transaction rollsback.
  2. Apply. With everything already in memory, it writes the changes. This step is infallible, so every transaction is applied completely or not at all.

Tiered storage changes where your data lives, but not the transactional guarantees SpacetimeDB has always given you.

(#6305, #6443, #6470, #6497, #6509, #6578)

What's next

This is just the first version. Coming soon:

  • Rollback-and-retry, which smooths out transactions that need to fault in cold data.
  • Tiered index storage, so indexes can leave memory too.
  • Database forking, so you can clone databases cheaply.
  • A bunch of internal changes to allow cool features like time travel!

Auto-reconnect in the C++/Unreal SDK

The Unreal SDK now automatically reconnects after a dropped connection, including token refresh. The Blackholio demo has been updated to use it.

(#6318)

Breaking Changes

Republishing previously used database names is more restricted

Permissions for republishing a previously used database name have been tightened. A publish that previously succeeded may now be rejected if you don't hold the required permissions for that name.

(#6547)

TypeScript SDK: errors from app callbacks now fail the connection

Errors thrown from application callbacks no longer escape the SDK. Instead, a bad message or callback error fails the connection gracefully. Code that relied on catching errors escaping SDK calls will no longer see them propagate.

(#6010)

spacetime generate emits mod.rs instead of lib.rs

Rust module receiver bindings now generate mod.rs as their root file instead of lib.rs. If your workflow references the generated lib.rs by name, update it to mod.rs.

(#6593)

Bug Fixes

TypeScript and C# SDKs: old clients now skip newly added columns

Adding a column to the end of a table previously broke older clients: TypeScript threw RangeError and C# silently returned wrong values. Rows are now read using the server-provided row boundaries, so trailing columns unknown to the client's bindings are skipped, matching the Rust SDK's behavior. Removing, reordering, or retyping a column still breaks old clients.

(#6091)

TypeScript SDK: fix crash on React Native during automatic reconnect

(#6511)

V8 module startup protected from heap exhaustion

Module compilation, evaluation, and schema extraction now apply the existing memory-limit termination mechanism, so a module that exhausts its heap fails startup cleanly instead of crashing the instance.

(#6572)

Fix seeding collisions in the TypeScript module RNG

(#6323)

CLI: fix the logout endpoint path

(#6606)

Improvements

Faster first lookups in the TypeScript SDK cache

Indexes are now built on first lookup rather than eagerly, and unique single-column indexes use a flat map, improving memory use and lookup performance.

(#6614)

Rust SDK: disable Nagle's algorithm

TCP_NODELAY is now set on Rust SDK connections, reducing latency for small, frequent messages.

(#6552)

Rust SDK: disable brotli's default ffi-api feature

(#6444)

Procedures interrupted when a database is paused or suspended

Running procedures are now cancelled when their database is paused or suspended. Cancellation takes effect at the next with_tx, HTTP, or sleep_until boundary; a procedure with none of these calls is still not stopped.

(#6537)

What's Changed

  • Integrated tiered storage in #6305
  • Added auto-reconnect to the C++/Unreal SDK in #6318
  • Made old TypeScript and C# clients skip columns added to a table in #6091
  • Fixed TypeScript SDK crashing Node on a bad message in #6010
  • Fixed TypeScript SDK crash on React Native with automatic reconnect in #6511
  • Protected V8 module startup from heap exhaustion in #6572
  • Fixed seeding collisions in the TypeScript module RNG in #6323
  • Fixed the CLI logout endpoint path in #6606
  • Fixed database name publication in #6547
  • Built TypeScript SDK cache indexes on first lookup with a flat map for unique single-column indexes in #6614
  • Disabled Nagle's algorithm in the Rust SDK in #6552
  • Disabled brotli's default ffi-api feature in the Rust SDK in #6444
  • Interrupted procedures when a database is paused or suspended in #6537
  • Emitted mod.rs as the Rust receiver bindings root in #6593
  • Bumped the openssl crate to support openssl 4 in #6583

Full public changelog: [v2.15.0...v2...

Read more

Release v2.15.0

Choose a tag to compare

@rekhoff rekhoff released this 10 Nov 19:20
07efb0c

Features

New TypeScript module packages

Four new opt-in TypeScript packages are available for SpacetimeDB modules, each with documentation, tests, and examples:

  • Agents: provider adapters, tool calls, conversation summaries, embeddings, and stale-lock cleanup.
  • Auth: password and OAuth handlers, ES256 sessions, connection binding, and profiles.
  • Files: upload, listing, deletion, per-file visibility, and HTTP serving helpers.
  • PostHog: server-side analytics and feature-flag evaluation, with durable queued events and explicit batch flushing.

(#5905, #5907)

Rust outbox! shorthand for async IDC

Rust modules can now declare an outbox table with spacetimedb::outbox!(receiver::reducer), which generates the message ID, target, and reducer argument columns from the module bindings. Optional accessor and name arguments are supported; manual #[spacetimedb::table(...)] declarations remain available.

(#6460)

Breaking Changes

C# module build: managed builds are now the default for .NET 10

.NET 10 C# module projects now build as managed assemblies by default; the CLI selects wasi-wasm explicitly for spacetime build and spacetime publish, which are unaffected. This prepares for upcoming C# module unit-testing support. .NET 8 projects are unaffected.

EXPERIMENTAL_WASM_AOT has been renamed to SPACETIMEDB_WASM_AOT (the legacy variable still works in the CLI). Do not define either symbol manually - the runtime's build targets set it automatically.

Existing .NET 10 modules may need to update their .csproj:

  1. Remove the unconditional <RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>.
  2. Make WASM-specific settings conditional on RuntimeIdentifier being wasi-wasm.
  3. Add explicit, conditional LLVM compiler package references - the runtime package no longer supplies them transitively.

A minimal .NET 10 project now looks like:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
  </PropertyGroup>

  <PropertyGroup Condition="'$(RuntimeIdentifier)' == 'wasi-wasm'">
    <PublishTrimmed>true</PublishTrimmed>
    <SelfContained>true</SelfContained>
    <MSBuildEnableWorkloadResolver>false</MSBuildEnableWorkloadResolver>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="SpacetimeDB.Runtime" Version="2.15.*" />
  </ItemGroup>

  <ItemGroup Condition="'$(RuntimeIdentifier)' == 'wasi-wasm'">
    <PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-*" />
    <PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-*" />
  </ItemGroup>
</Project>

Keep your existing project-specific settings, such as nullable analysis, implicit usings, assembly names, and other dependencies. LLVM packages still require the dotnet-experimental NuGet feed.

(#6346)

Bug Fixes

clear_table no longer double-counts rows

MutTxId::clear_table previously counted every committed row as removed, including rows already deleted by the same transaction. It now counts only newly deleted rows. Note this changes the module ABI clear() return value in that case, for every module language.

(#6499)

TypeScript SDK: fix types for NodeNext consumers

Importing spacetimedb with moduleResolution: "nodenext" no longer fails with missing exported members (e.g. Timestamp). Generated bindings additionally need the --import-extension flag from #6097 to compile under NodeNext.

(#6009)

TypeScript SDK: deprecation notes now reach db without a declare field

Deprecated names are now properly crossed out on conn.db, inside callbacks, and on EventContext. This also fixes generated bindings being rejected by Expo's Babel preset (React Native). No runtime change.

(#6013)

Check publication permissions before reserving database names

A publish attempt rejected by permission checks could still reserve its requested database name. Permissions are now checked before the name is registered.

(#6457)

Fix database identity publish

Corrects publishing behavior related to database identities. Previously released as a hotfix; now merged into mainline. Publishing by name is unaffected.

(#6507)

Improvements

Faster find/filter in the TypeScript SDK

The TypeScript SDK now uses a map for lookups on indexed columns, making find and filter significantly faster.

(#6416)

CLI: warning before using a server-issued login

Commands that auto-accepted a server-issued login when passed --yes now warn and ask for confirmation, avoiding a "split identity" between a local server and maincloud. Using your spacetimedb.com login on all servers remains the intended setup.

(#6337)

CLI: yes/no prompts restored on EOF

CLI yes/no prompts once again use their configured default on EOF, restoring the pre-2.14 behavior.

(#6458)

What's Changed

  • Added agents, authentication, and file module packages for TypeScript modules in #5905
  • Added a PostHog analytics module for TypeScript modules in #5907
  • Added the spacetimedb::outbox! Rust shorthand for async IDC in #6460
  • Made managed builds the default for .NET 10 C# modules and renamed EXPERIMENTAL_WASM_AOT to SPACETIMEDB_WASM_AOT in #6346
  • Fixed clear_table double-counting rows already deleted in the same transaction in #6499
  • Fixed TypeScript SDK types for NodeNext consumers in #6009
  • Fixed TypeScript SDK deprecation notes so generated bindings work with Babel/Expo in #6013
  • Checked publication permissions before reserving database names in #6457
  • Fixed database identity publish in #6507
  • Made find/filter use indexed lookups in the TypeScript SDK in #6416
  • Added a CLI warning before using a server-issued login in #6337
  • Restored the CLI yes/no prompt default on EOF in #6458

Full public changelog: v2.14.1...v2.15.0

Release v2.14.1

Choose a tag to compare

@rekhoff rekhoff released this 04 Nov 20:16
a0bf6be

Bug Fixes

Refresh TLS trust following the eMudhra/emSign CA incident

Updated TLS certificate verification dependencies and refreshed certificate trust stores in distributed container images to address the eMudhra/emSign certificate authority key compromise. The updated WebPKI verifier rejects the compromised intermediate keys, and affected roots are removed from the Nix development environment's CA bundle.

Operators should upgrade their SpacetimeDB binaries and container images. See the RustSec advisory for details about the upstream incident.

(#6366)

Preserve UUID and branded primitive types in TypeScript

TypeScript type inference now preserves Uuid values and branded primitives instead of expanding them into structural records. UUID columns retain their Uuid type, and branded strings remain assignable to string. This is a types-only fix with no runtime behavior change.

(#5971)

Restore Nix development builds

Updated the Nix flake to Rust 1.97.1 and pinned the required wasm-bindgen version, restoring the Nix development workflow.

(#6344)

What's Changed

  • Updated TLS verification dependencies and container trust stores following the eMudhra/emSign CA incident in #6366
  • Fixed TypeScript inference for UUIDs and branded primitives in #5971
  • Restored Nix development builds in #6344

Full public changelog: v2.14.0...v2.14.1

Release v2.14.0

Choose a tag to compare

@rekhoff rekhoff released this 30 Oct 18:43
7c3ee55

New Features

🚀 Async inter-database communication 🚀

Rust and TypeScript modules can now call reducers in other databases asynchronously through declared dependencies and generated receiver bindings. A module declares its dependencies in spacetime.json, referencing either a local module path or a published database, and spacetime generate produces typed receiver bindings for each dependency, while spacetime dev publishes dependency databases alongside the main one.

Senders enqueue calls by inserting rows into generated outbox tables, which are insert-only and map their columns to the receiver's reducer parameters with compile-time type checking. Delivery is handled by a new IDC actor that manages concurrent outbox streams over HTTP/2, and optional on_result / onResult callbacks report delivery outcomes back to the sender. Dependencies are namespaced by name, so a module can depend on two databases that export identically named types.

Note: C# and C++ Async IDC are coming in a future release.

(#6156, #6313, #6364, #6375, #6376, #6327)

Nested C# submodules

C# modules can now nest submodules to arbitrary depth, and the same module assembly can be mounted as multiple independent instances. Tables, indexes, reducers, procedures, and views are routed to the correct instance; ctx.As selects an instance when passing context to functions, ctx.From provides instance-aware query builders, and scheduling overloads are context-aware. Generated C# client bindings expose nested namespace paths such as ctx.Db.SubmoduleA.SubmoduleC.

(#6112)

Import extensions in generated TypeScript bindings

spacetime generate --lang typescript now accepts --import-extension none|js|ts, also settable per generate entry in spacetime.json. Generated bindings can therefore work out of the box with moduleResolution: "nodenext" and runtimes that execute TypeScript directly (Node, Bun, Deno) without post-generate patching. The default, none, preserves existing output.

(#6097)

Breaking Changes

Consistent is_internal() semantics across module languages

is_internal() now means ctx.sender() == ctx.database_identity() in every module library. Previously Rust, C#, and C++ inferred it from a missing ConnectionId and TypeScript always reported false. HTTP handlers now run with a real per-request identity and JWT instead of Identity::ZERO, and their transactions keep that sender and JWT.

Behavior changes to be aware of:

  • init is no longer internal, since its sender is the database owner.
  • In TypeScript, isInternal is now true for scheduled reducers and procedures.
  • jwt() is none whenever is_internal() is true.
  • HTTP handlers (unstable) expose a sender: ctx.sender() in Rust and C++, ctx.sender in TypeScript, ctx.Sender in C#.
  • C++ get_caller_identity() now returns the sender rather than the database identity for callers without a JWT.

Modules built with older libraries keep their previous behavior until rebuilt; modules built with the new libraries export an updated __call_http_handler__ that older hosts will reject.

(#5892)

Bug Fixes

Generated TypeScript schemas typecheck with exactOptionalPropertyTypes

Generated TypeScript bindings no longer fail typechecking or produce never for conn.reducers when a project enables exactOptionalPropertyTypes. The affected option types now declare name?: string | undefined; there is no runtime change.

(#6096)

What's Changed

  • Added async inter-database communication: spacetime.json dependencies, generated Rust and TypeScript receiver bindings, insert-only outbox tables with typed parameters, result callbacks, and the IDC delivery actor in #6156, #6313, #6364, #6375, #6376, and #6327
  • Added nested C# submodules with instance-aware contexts, queries, and scheduling in #6112
  • Added --import-extension to spacetime generate --lang typescript in #6097
  • Standardized is_internal() across module languages and gave HTTP handlers a sender and JWT in #5892
  • Fixed generated TypeScript bindings under exactOptionalPropertyTypes in #6096

Full public changelog: v2.13.0...release/candidate/v2.14.0

Release v2.13.0

Choose a tag to compare

@rekhoff rekhoff released this 21 Oct 20:02
08e1aba

New Features

Reusable TypeScript submodules

TypeScript modules can now use a collection of reusable submodules for common application needs. The initial packages provide cron-style and interval scheduling, retry with exponential backoff, fixed-window rate limiting, cryptographic and encoding helpers, and Resend email integration.

The packages include typed APIs, installation documentation, tests, and examples. They can be installed in projects using SpacetimeDB 2.12 or later.

(#5903, #6158, #6309)

C# module submodules and namespaces

C# modules can now compose separately built module assemblies as submodules. Assembly-level namespace declarations control how a dependency is exposed in C# and, optionally, its canonical database namespace.

Namespaced tables, indexes, views, query builders, reducers, procedures, schedules, generated clients, subscriptions, and row-level security are supported. A module assembly can be published independently or referenced as a dependency without requiring a separate library build mode.

(#5974)

SpacetimeAuth management from the CLI

The new spacetime auth command group lets Maincloud users manage a database's SpacetimeAuth configuration from the command line. It supports identity-provider configuration, project settings, and client creation, inspection, and deletion.

(#5251)

Improvements

Confirmed HTTP calls now wait for durability

Confirmed HTTP reducer calls now report success only after their transaction is durable. Procedures using confirmed reads likewise wait for transactions opened through withTx to become durable before returning, preventing subsequent confirmed work from observing state that could still be lost in a crash.

Confirmation waits have a five-second deadline. A timed-out HTTP call returns 504 Gateway Timeout with an unknown-outcome error. Callers that do not require this guarantee can continue to use confirmed=false.

(#6101, #6154)

Lower subscription memory overhead

The datastore no longer clones the full subscriber state for each transaction. It records transaction-local subscriber and timestamp changes instead, substantially reducing memory usage for databases with many subscribers while preserving subscription and view behavior.

(#6113)

Deterministic TypeScript shuffling

TypeScript modules now provide deterministic random shuffling alongside the existing deterministic random helpers, making shuffled behavior reproducible within module execution and tests.

(#6040)

More complete module unit testing

Rust module unit tests can now access declared environment values and exercise procedures that open transactions with withTx. A new guide documents module unit testing for both Rust and TypeScript.

(#6302, #6245)

Security

Updated .NET XML cryptography dependency

The C# toolchain now uses an updated System.Security.Cryptography.Xml dependency that addresses a known vulnerability in the previous package version.

(#6290)

Bug Fixes

Correct TypeScript Result types and serialization

TypeScript result builders now use the same { ok: value } | { err: value } representation as the serializer and deserializer, and error values serialize with the correct variant. Code that compiled against the previous incorrect result shape may require adjustment, but the old shape could not work correctly at runtime.

(#6148)

Fixed TypeScript procedure HTTP edge cases

TypeScript module HTTP requests and handler responses no longer split header values at commas. This fixes headers such as webhook signatures, HTTP dates, and cookies with Expires attributes. ctx.http.fetch also accepts nonstandard status codes, such as proxy-specific 5xx responses, instead of throwing while constructing the response.

(#6140)

Fixed recursive C# struct type comparison

C# BSATN code generation no longer recurses indefinitely when comparing recursive struct type definitions.

(#6303)

Fixed generated project dependency paths

New projects created from templates now correctly rewrite module unit-test dependencies that use repository-local paths during development. Generated projects can once again build outside the SpacetimeDB source tree.

(#6307)

What's Changed

  • Added reusable TypeScript cron, retry, rate-limit, crypto, and Resend submodules in #5903, #6158, and #6309
  • Added C# module submodules and namespace-aware generated APIs in #5974
  • Added the spacetime auth CLI management commands in #5251
  • Made confirmed procedure transactions and HTTP reducer calls wait for durability in #6101 and #6154
  • Reduced subscription memory overhead by replacing full subscriber-state clones with transaction-local deltas in #6113
  • Added deterministic TypeScript random shuffling in #6040
  • Fixed TypeScript Result typing and error serialization in #6148
  • Fixed comma-containing HTTP headers and unknown status codes in TypeScript ctx.http.fetch in #6140
  • Fixed Rust module tests for procedure transactions and environment values in #6302
  • Fixed infinite recursion in C# BSATN type-definition comparison in #6303
  • Fixed repository-local dependency paths in generated CLI projects in #6307
  • Updated System.Security.Cryptography.Xml to address a known vulnerability in #6290

Full public changelog: v2.12.0...release/candidate/v2.13.0

Release v2.12.0

Choose a tag to compare

@rekhoff rekhoff released this 13 Oct 18:44
2f8905d

New Features

Persistent typed database environments

SpacetimeDB modules can now declare typed environment variables for configuration and secrets. Rust, TypeScript, C#, and C++ modules can read declared values through their execution context, with support for required and optional strings as well as constrained sets of allowed values.

Values can come from project configuration or the publishing process's environment. They are validated against the module's declarations and updated atomically with a module publish. Stored values are preserved by default across publishes, while --env-only, --unset-env, and --replace-env support configuration changes without replacing the module. Authorized users can inspect published values with spacetime env get and spacetime env list.

(#5887, #5961, #6004)

Automatic reconnect for TypeScript and C# clients

The TypeScript and C# SDKs can now keep a DbConnection, its client cache, subscriptions, table handles, and registered callbacks usable across temporary connection loss. Applications can opt in with withAutomaticReconnect() in TypeScript or WithAutomaticReconnect() in C#.

Reconnect attempts use exponential backoff, replay active subscriptions, reconcile the refreshed state with the existing client cache, and preserve the client's identity. Applications using expiring credentials can provide refreshed tokens through withTokenProvider() or WithTokenProvider().

Rust and C++ are coming in a future update.

(#5927, #5956)

Unit testing for Rust and TypeScript modules

Rust and TypeScript modules can now test module logic against an in-memory datastore without publishing to a running SpacetimeDB server. The new test utilities support reducer transactions, procedure and view contexts, typed queries, authentication, deterministic clock and random-number helpers, and mocked procedure HTTP behavior.

The Rust API is available through spacetimedb::test_utils, while TypeScript modules can use spacetimedb/server/test-utils with Vitest. The Rust console-chat and TypeScript React-chat templates include example tests.

TypeScript module tests now also work when the SDK is installed from npm rather than a workspace checkout. Mock HTTP responders can return string or binary response bodies, allowing procedures under test to consume mocked responses through APIs such as text() and json().

(#5558, #6139)

Improvements

HTTP/2 support for procedure HTTPS requests

Outbound HTTPS requests from procedures now negotiate HTTP/2 when the remote service supports it. This allows modules to call HTTP/2-only APIs such as Apple Push Notification service while remaining compatible with HTTP/1.1 servers.

(#6012)

Rollback-safe system-table additions

New databases now write system-table schema information to the commit log before writing rows to those tables. This allows older SpacetimeDB versions to replay databases containing system tables they do not recognize, improving rollback safety for this and future releases.

(#6004)

Clearer local schema validation errors

spacetime publish, spacetime generate, and other commands that inspect a module locally now include the underlying schema validation or module-inspector diagnostic instead of reporting only that schema inspection failed.

(#6079)

Security

Symmetric JWT signing algorithms are rejected

SpacetimeDB now rejects JWTs signed with HS256. Symmetric signing cannot be validated through an issuer's public key in the same way as supported asymmetric algorithms, so these tokens are no longer accepted for authentication.

(#6100)

Bug Fixes

Isolated PostgreSQL authentication state per connection

The PostgreSQL wire-protocol server now keeps authentication and session state isolated to each client connection. SQL execution is rejected until that connection has completed authentication, preventing failed or incomplete connection attempts from inheriting another connection's database or identity.

(#6134)

Fixed duplicate interval-scheduled reducer calls

Updating an interval-scheduled row without changing its scheduling data no longer leaves duplicate pending queue entries for the same row. The scheduler now replaces the existing pending entry instead of enqueueing an additional call.

(#5951)

Fixed TypeScript compiler detection on Windows

The CLI now recognizes tsc.exe in addition to tsc.cmd when locating the TypeScript compiler. This restores type checking for Windows projects using package managers such as Bun.

(#6024)

Fixed missing TypeScript SDK build dependency

The TypeScript SDK now declares terser as a development dependency, making clean SDK builds reproducible without relying on an undeclared package.

(#6083)

Additional Changes

  • The SDK test suite was split into a dedicated package and harness to simplify shared cross-SDK testing. (#5854)
  • The Rust toolchain was updated to 1.97.1. (#6080)
  • CLI documentation now links to the correct Rust API documentation. (#6028)
  • Internal groundwork for asynchronous inter-database communication was added, but asynchronous IDC is not yet exposed as a complete user-facing feature. (#6084, #6104)

What's Changed

  • Added persistent typed database environments for Rust, TypeScript, C#, and C++ modules in #5887, refined their publishing API in #5961, and made system-table additions rollback safe in #6004
  • Added Automatic reconnect for TypeScript clients in #5927
  • Added Automatic reconnect for C# clients in #5956
  • Added Rust and TypeScript module unit-testing support in #5558 and fixed npm-installed TypeScript test projects and mocked HTTP response bodies in #6139
  • Enabled HTTP/2 negotiation for procedure HTTPS requests in #6012
  • Restored detailed schema validation diagnostics in #6079
  • Rejected JWTs signed with symmetric HS256 in #6100
  • Isolated PostgreSQL authentication and session state per connection in #6134
  • Fixed duplicate pending interval-scheduled reducer calls in #5951
  • Fixed TypeScript compiler detection for Bun projects on Windows in #6024
  • Declared the TypeScript SDK's terser development dependency in #6083
  • Split the SDK test suite into a dedicated package and harness in #5854
  • Added the first internal components for asynchronous inter-database communication in #6084 and #6104

Full public changelog: v2.11.0...release/candidate/v2.12.0

Release v2.11.0

Choose a tag to compare

@rekhoff rekhoff released this 07 Oct 17:53
6b6e0ab

SpacetimeDB v2.11.0

Security Notice

On September 1, we became aware of a security vulnerability in SpacetimeDB that allowed an attacker who knew a token’s subject and issuer to impersonate the corresponding Identity. We released a patch on September 4 in v2.10.0, upgrading our JWT authentication library to address the issue. We waited 30 days after the release before publicly disclosing the vulnerability to give users time to upgrade. We recommend that everyone running an earlier version upgrade to v2.10.0 or later as soon as possible to avoid being affected by this vulnerability.

We are not aware of any instances of the vulnerability being actively exploited in the wild.

New Features

Human-readable database descriptions

spacetime describe can now print a readable description of a database schema in addition to its machine-readable form. The output makes it easier to inspect tables, reducers, types, indexes, constraints, sequences, schedules, and row-level security rules directly from the CLI.

(#5947)

Improvements

Clearer database update failures

Failed database updates now print the complete error chain instead of only the outermost error. This provides the underlying validation or migration failure directly in CLI and server output, making failed publishes and updates easier to diagnose.

(#6046)

More reliable C# subscriptions and indexes

The C# SDK now handles an unsubscribe request made before a subscription becomes active, permits enum-valued index columns, and validates malformed fixed-size row data instead of risking a divide-by-zero failure.

(#5684)

Clearer custom installation paths

CLI self-install and update behavior now handles custom --root-dir installation paths more consistently, with clearer documentation for self-hosted installations.

(#6008)

Bug Fixes

Fixed generated React projects

spacetime init --template react-ts now writes the generated database name to .env.local. Previously, projects whose generated database name differed from the local project name could be created with a broken initial configuration.

(#5941)

Correct authorization inside HTTP handler transactions

HTTP handlers now preserve the caller's authorization context when opening transactions. This fixes authenticated operations that could incorrectly run with internal authority.

(#5978)

Fixed repeated C++ JWT claim access

C++ modules can now read authentication claims repeatedly without exhausting the underlying byte source.

(#5977)

Additional Changes

  • C# SDK testing now uses the shared SDK test suite and harness, expanding coverage for subscriptions, procedures, views, and connection lifecycle behavior. (#5684)
  • macOS C# quickstart documentation includes the current .NET 10 workaround. (#5727)
  • CLI documentation no longer lists the nonexistent --force option. (#5988)
  • Documentation and agent-facing resources now point to the official SpacetimeDB agent tooling, and the README uses the current X account link. (#6077, #6078)

What's Changed

  • Added human-readable output to spacetime describe in #5947
  • Printed complete error chains for failed database updates in #6046
  • Fixed generated React template database names in .env.local in #5941
  • Fixed authorization context inside HTTP handler transactions in #5978
  • Fixed repeated C++ JWT claim access in #5977
  • Expanded C# SDK test coverage and fixed subscription, enum-index, and malformed-row edge cases in #5684
  • Improved custom --root-dir installation behavior and documentation in #6008
  • Documented the macOS .NET 10 workaround in #5727
  • Removed the nonexistent CLI --force option from documentation in #5988
  • Improved test reliability after memoization lock poisoning in #5846
  • Added SQL parser regression coverage in #5932
  • Updated agent-tooling links and the README social link in #6077 and #6078

Full public changelog: v2.10.2...release/candidate/v2.11.0

Release v2.10.2

Choose a tag to compare

@rekhoff rekhoff released this 29 Sep 18:36
58d2a40

Improvements

Transparent compression for procedure HTTP requests

Outbound HTTP requests made by module procedures now advertise gzip and Brotli support and transparently decode compressed responses. This reduces transfer size and latency without module changes.

Modules that manually set Accept-Encoding and decompress responses themselves should remove their manual decompression. Response Content-Encoding and compressed Content-Length headers are removed after decoding, and HTTP response-size metrics now report decompressed bytes.

(#5698)

Faster TypeScript string serialization

TypeScript module bindings now avoid per-string codec allocation and use an allocation-free fast path for ASCII strings. Serialized bytes and public APIs are unchanged.

(#5783)

Canonical namespace names across languages

Module, table, reducer, and type namespaces are now canonicalized consistently during schema validation and code generation. This fixes mismatches where Rust, TypeScript, C#, C++, and the generated client APIs handled namespace casing or punctuation differently, and makes multi-language module projects more predictable.

(#5967)

Simpler, stricter sequence handling

Non-transactional sequence state has been removed and non-default sequence parameters are no longer allowed. Sequences now behave more predictably during transactions, recovery, and replication, and modules that relied on unsupported sequence options will fail validation with a clear error instead of silently misbehaving.

(#5880)

Reliability

Stronger replicated commit durability

Maincloud replication now confirms that commit-log data is durable before advancing the Omnipaxos decided index. This prevents a crash-recovery state where consensus metadata can be ahead of the durable commit log.

Safer TypeScript WebSocket decompression

TypeScript SDK WebSocket message decompression is now sequenced correctly, preventing out-of-memory errors that could occur when multiple compressed messages arrived in rapid succession.

(#5845)

Replication startup and follower synchronization fixes

Replication startup has been hardened against races during cluster initialization, and follower peer synchronization has been corrected to avoid stale replica state after topology changes.

Additional Changes

  • Scheduled functions that overrun their interval no longer produce repetitive warning-level log messages. (#5963)
  • Documentation now includes an official agent setup guide with the Zen of Spacetime, updated scheduled-function and C# client guidance, repaired redirects, and an updated Railway deployment link. (#5928, #5968, #5917, #5916, #5948, #5959)

What's Changed

  • Server groundwork for automatic client reconnection in #5877
  • Transparent gzip/Brotli decompression for procedure HTTP responses in #5698
  • Faster TypeScript string serialization with an ASCII fast path in #5783
  • Canonical namespace names across module languages and generated clients in #5967
  • Stricter sequence handling by removing non-transactional sequence state in #5880
  • Safer TypeScript WebSocket decompression sequencing in #5845
  • Updated scheduled-function and C# client documentation in #5917
  • Redirected dead documentation URLs and fixed in-repo links in #5916
  • Updated Railway deploy button in #5948
  • Fixed README SQL reference link in #5959
  • Added official SpacetimeDB agent setup guide in #5928
  • Introduced the Zen of Spacetime in the agent setup guide in #5968
  • Reduced scheduled-function overrun log noise from warning to trace in #5963

Full public changelog: v2.10.1...release/candidate/v2.10.2

Release v2.10.1

Choose a tag to compare

@rekhoff rekhoff released this 15 Sep 18:02
3d76070

Bug Fixes

CLI commands now respect the project's configured server

spacetime list, spacetime rename, and spacetime mcp now read the server value from spacetime.json instead of falling back to the CLI's global default. This makes authentication and target server selection consistent with spacetime call, spacetime logs, spacetime sql, and other database-addressing commands.

(#5883)

Scheduled functions no longer block behind slow calls

The scheduler previously awaited each scheduled function to completion before dispatching the next one, causing head-of-line blocking and delaying scheduled reducers behind slow procedures. handle_queued now submits scheduled calls to the executor concurrently, bounded at the ModuleHost level like normal reducers. Already-expired scheduled functions are no longer guaranteed to run in strict scheduled_at order, but timestamps observed inside reducers remain monotonic.

(#5736)

Performance

C# SDK performance boost

The C# SDK now uses direct loops in place of some LINQ, pools arrays, uses smaller initial WebSocket buffers, and avoids several .ToArray() calls. The biggest improvements are in brotli-decompressed transaction updates and reducer/procedure payloads, with fewer allocations across SpacetimeDBClient, WebSocket, BSATNHelpers, and decompression.

(#5840)

What's Changed

  • Make spacetime list, rename and mcp respect the project's server in #5883
  • Scheduled functions: Concurrent execution by not awaiting on current run. in #5736
  • SDK Performance Boost in #5840
  • docs: update automatic migration compatibility notes in #5723
  • Fix broken links in C# SDK README in #5888

Full Changelog: v2.10.0...v2.10.1