github clockworklabs/SpacetimeDB v0.11.0-beta

latest releases: v0.11.1-beta, v-kmullins-docker-tagging-test-3, v-kmullins-docker-tagging-test-2...
one month ago

We have a big release for you today 🎉 🎉 ! We're including some big performance improvements ⚡ and long-awaited bugfixes 🐞! Remember to stay tuned for our 0.12 release soon.

This release includes some major breaking changes, so you won't be able to use your old databases with this version. Run spacetime local clear to remove them.

Important changes

Major

  • ⚡ We removed our usage of protobuf, in favor of our own internal format (#1077) - this is a big performance improvement on the client and the server!
  • ⌛ We removed the server-side schedule! macro and its equivalents in favor of table-based timers (#1449). Please check our server module docs for more info on how to use the new system.

Here is some example code which uses the new timer tables:

// The `scheduled` attribute links this table to a reducer.
#[spacetimedb(table, scheduled(send_message))]
struct SendMessageTimer {
    text: String,
}

// Reducers linked to the scheduler table should have their first argument as `ReducerContext` 
// and the second as an instance of the table struct it is linked to.
#[spacetimedb(reducer)]
fn send_message(ctx: ReducerContext, arg: SendMessageTimer) -> Result<(), String> {
    // ...
}

// Scheduling reducers inside `init` reducer
fn init() {
    // Scheduling a reducer for a specific Timestamp
    SendMessageTimer::insert(SendMessageTimer {
        scheduled_id: 0,
        text:"bot sending a message".to_string(),
        //`spacetimedb::Timestamp` implements `From` trait to `ScheduleAt::Time`. 
        scheduled_at: ctx.timestamp.plus(Duration::from_secs(10)).into()
    });

    // Scheduling a reducer to be called at fixed interval of 100 milliseconds.
    SendMessageTimer::insert(SendMessageTimer {
        scheduled_id: 0,
        text:"bot sending a message".to_string(),
        //`std::time::Duration` implements `From` trait to `ScheduleAt::Duration`. 
        scheduled_at: duration!(100ms).into(),
    });
}

CLI changes

  • CLI subcommands consistently use --server and --identity args consistently instead of anonymous args (#1482)
  • We have a new subscribe subcommand! (#1343)
  • Bugfix: Update help text suggesting spacetime server fingerprint to have the correct -s param (#1457)
  • Bugfix: spacetime server add - Remove trailing /s from server URIs (#1552)

Web API

  • Recovery code APIs are now under /identity and using POST (#1492)
  • /identity GET returns an empty success if the email address is not found (#1491)

C#

  • Use latest C# in BSATN.Runtime (#1548)
  • Fixed exceptions in C# SDK when someone disconnects or when a transaction originates from CLI (#1461)
  • Include BSATN.Codegen in nuget pack (#1424)
  • Generate tagged enums in C# client code (#1421)
  • Restructure NuGet packaging (#1440)
  • Restructure C# SpacetimeDB runtime (#1455)
  • Implement the module rng proposal for C# (#1425)
  • Roslyn cacheability testing and fixes (#1420)

Using SpacetimeDB as a library

  • table: Make with_mut_schema clone-on-write (#1530)
  • Fix running 'cargo test' in crates/lib (#1478)
  • Move db module from spacetimedb_sats to spacetimedb_lib (#1479)
  • Move schemas to schema crate, rename Def to RawDefV8 (#1498)
  • core: Simplify custom bootstrap (#1404)
  • TableDef: clarify generated_* methods (#1419)
  • Make some commitlog helpers public (#1390)
  • perf(1351): Add a row count metric for subscriptions (#1435)

Bugfixes

  • ST sequences: respect allocated amount on restart (#1532)
  • Drain scheduler Actor channel before start (#1529)
  • Table::is_row_present: don't panic (#1526)
  • Ignore some sequence allocation mismatches when checking for compatible updates (#1524)
  • Fix inconsistent auth/identity creation (#735)
  • ColList: preserve list order on list.push(..) (#1474)
  • HACK: Tweak schema_updates to allow adding/removing non-unique indices (#1434)
  • Fix index removal and additions + add smoketest (#1444)
  • fix(1409): Counter metric names (#1411)
  • core: Downgrade host log verbosity (#1446)
  • Implement a temporary type check validation on sql compiling (#1456)
  • core: Replace host scheduler on update (#1453)

Changelog

Full Changelog: v0.10.1-beta...v0.11.0-beta

Don't miss a new SpacetimeDB release

NewReleases is sending notifications on new releases.