Commit Graph

2763 Commits

Author SHA1 Message Date
Phoebe Goldman 111bc1a1f9 Rename docs dirs and files to have more digits (#3851)
# Description of Changes

This makes it possible to insert new pages between existing pages
without renaming the existing pages.

I also added a section to docs/README.md with procedure for how to name
new pages, which I'll paste here:

### Adding new pages

All of our directory and file names are prefixed with a five-digit
number which determines how they're sorted.
We started with the hundreds place as the smallest significant digit, to
allow using the tens and ones places to add new pages between.
When adding a new page in between two existing pages, choose a number
which:

- Doesn't use any more significant figures than it needs to.
- Is approximately halfway between the previous and next page.

For example, if you want to add a new page between `00300-foo` and
`00400-bar`, name it `00350-baz`. To add a new page between `00350-baz`
and `00400-bar`, prefer `00370-quux` or `00380-quux`, rather than
`00375-quux`, to avoid populating the ones place.

To add a new page after all previous pages, use the smallest multiple of
100 larger than all other pages. For example, if the highest-numbered
existing page is `01350-abc`, create `01400-def`.

# API and ABI breaking changes

N/a

# Expected complexity level and risk

1 - @JulienLavocat said this wouldn't break anything.

# Testing

None.

---------

Co-authored-by: Jason Larabie <jason@clockworklabs.io>
2025-12-09 19:11:48 +00:00
Kim Altintop 16f1b2c1fe client-api: Deny changing the parent of an existing database (#3837)
Mainly a smoketest to exercise the intended behaviour. Also return an
error if we end up delegating to the reset database endpoint, which
itself doesn't accept a `parent` parameter.
2025-12-09 18:35:48 +00:00
John Detter 7e367b38a6 Update typescript package size limits (#3854)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

Updated package sizes from a failed release dry-run:
https://github.com/clockworklabs/SpacetimeDBPrivate/actions/runs/20045893743/job/57491806595

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

1 - this is just a release fix

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

I have not tested this, it is a trivial change.
2025-12-09 11:02:33 +00:00
Kim Altintop 062649c92e client-api: Send WebSocket messages fragmented (#2931)
RFC 6455, Section 5.4 describes message fragmentation, and we can do
that with tungstenite.

It does seem to help getting control messages (ping, pong, close)
through without head-of-line blocking.

# Expected complexity level and risk

2 - Need to test with clients

# Testing

TBD - some more abstraction is needed due to the difficulty of
synthetically producing a large outgoing message.
2025-12-09 09:21:11 +00:00
Noa af5b04e949 Implement sourcemap handling (#3828)
# Description of Changes

Uses the `sourcemap` crate to map text locations in the bundle to text
locations in the original source code.

# Expected complexity level and risk

1 - essentially only related to diagnostics

# Testing

- [x] Manually tested
- [ ] Add an automated test for backtrace output
2025-12-08 22:29:54 +00:00
Shubham Mishra 5100aec3d4 Some more UI tests for Views (#3829)
# Description of Changes
As title

# API and ABI breaking changes
NA

# Expected complexity level and risk
0

---------

Signed-off-by: Shubham Mishra <shivam828787@gmail.com>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2025-12-08 19:33:02 +00:00
joshua-spacetime 93c0015f51 fix error when dropping view in auto-migration (#3836)
# Description of Changes

Fixes the following issues:
1. When dropping a view, we deleted its row from `st_view`, but didn't
drop the backing table.
2. `delete_col_eq` returned a nonsensical error if the delete set was
empty.

# API and ABI breaking changes

None

# Expected complexity level and risk

0

# Testing

- [x] Auto-migrate smoketests
2025-12-08 07:01:21 +00:00
Noa afe169ac4a Fix the issues with scheduling procedures (#3816)
# Description of Changes

This reapplies the patch from #3704, and fixes the issues that were
causing it to deadlock.

The reason it was deadlocking was that it allowed for the following
sequence of events:
* `SchedulerActor::handle_queued()` begins mutable tx
* `ModuleHost::disconnect_client()` submits call to `call_reducer(tx:
None)`
* scheduler submits call to `call_reducer(tx: Some)`
* `WasmModuleInstance::disconnect_client` now has to try to take tx
lock, but the scheduler's call_reducer already holds it and is behind it
in the queue

So, I moved most of the logic from `handle_queued` back to being
executed in the module worker thread, but kept the code in
`scheduler.rs` so that it can all be reasoned about locally.

Fixes #3645. Should I uncomment the implementation of
`ExportFunctionForScheduledTable for F: Procedure` now?

# Expected complexity level and risk

2 - there's a chance that this patch hasn't fully fixed the deadlock
issue from #3704, but I'm quite confident.

# Testing

- [x] Manually verified that deadlock no longer occurs - previously,
`while true; do python -m smoketests schedule_reducer -k
test_scheduled_table_subscription; done` would freeze up in only 2 or 3
iterations, but now it can run for 10 minutes without issues.
2025-12-05 22:27:30 +00:00
Piotr Sarnacki e0dc9fb261 Remove energy multiplier from wasmtime fuel calculations (#3832)
# Description of Changes

In the past we've been converting CPU instructions into energy. We are
not doing it on the SpacetimeDB side anymore, thus we should report the
WasmTime fuel directly
2025-12-05 19:09:28 +00:00
Shubham Mishra 013b202861 Views: snapshot to skip ephermeral tables (#3720)
# Description of Changes.
fixes #3715 

The patch makes snapshots to skip ephemeral tables.

# API and ABI breaking changes
NA

# Expected complexity level and risk
1

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [ ] <!-- maybe a test you want to do -->
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->

---------

Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2025-12-05 09:20:41 +00:00
Jeffrey Dallatezza 3e7ab2ccac Add a typescript query builder for views (#3812)
# Description of Changes

This adds a way to build queries with typescript views, and it allows
views to return queries (if the return type of the query is an array).

For examples and syntax, you can look at the tests in
[crates/bindings-typescript/tests/query.test.ts](https://github.com/clockworklabs/SpacetimeDB/compare/jsdt/ts-query-builder?expand=1#diff-4fd25c191f1207085a491cf84996c601f805f5e8280d1cf2a812ebad6aa6e75a).

To play around with the syntax, you might find it easier to look in
[crates/bindings-typescript/src/server/view.test-d.ts](https://github.com/clockworklabs/SpacetimeDB/compare/jsdt/ts-query-builder?expand=1#diff-4fd25c191f1207085a491cf84996c601f805f5e8280d1cf2a812ebad6aa6e75a).

This could still use some cleanup, and there are some places where the
type safety is imperfect. I'll try to list the known limitations here:
1. This will allow the use of `eq` for columns that are product types,
even though the query engine doesn't support it. This can be fixed
later, and it would only be a breaking change for modules that have
invalid queries.
2. When we check if a view is returning a query of the correct type, we
are checking with the typescript row type. We should be checking with
the spacetime type, since this type checking will allow a couple
incorrect things to be returned:
1. A different table with any superset of the fields (for example, a
different table that has one extra field). That will fail when
executing, but will be allowed by the typescript compiler.
2. A table with the same fields, but with those fields in a different
order would also fail at runtime, but be allowed by the typescript
compiler.
4. A table with fields of a different spacetimetype that map to the same
typescript type (like `u16` and `u32`).

I can also add back functions for things like inequality once we are ok
with the rest of it.

# API and ABI breaking changes

This adds some new API surface, but does not break existing code.

# Expected complexity level and risk

2.

# Testing

For automated tests, there are unit tests to see what sql gets emitted
in `tests/query.test.ts`, and some tests of the types in
`view.test-d.ts`.

I've also run some manual tests with a typescript module with views.
2025-12-04 23:02:33 +00:00
Tyler Cloutier 46f3e07dfc Fixes issues with --delete-data=on-conflict (#3730)
# Description of Changes

Fixes https://github.com/clockworklabs/SpacetimeDB/issues/3729

I genuinely don't know what came over me.

# API and ABI breaking changes

None

# Expected complexity level and risk

1.5 very straightforward but not strictly trivial

# Testing
Adds automated integration tests (written in Rust and run with `cargo
test`, although note this comment from @matklad about integration tests
for the future
https://internals.rust-lang.org/t/running-test-crates-in-parallel/15639/2):

- [x] Can publish an updated module if no migration is required
- [x] Can publish an updated module if auto-migration is required (with
the yes-break flag true/false)
- [x] Cannot publish if a manual migration is required
- [x] Can publish if a manual migration is required but the user
specified `--delete-data`
- [x] Can publish if a manual migration is required by the user
specified `--delete-data=on-conflict`
- [x] No data deletion occurs if no migration is required and
`--delete-data=on-conflict` is specified

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2025-12-04 21:45:41 +00:00
Kim Altintop a959996ba7 Debug "stuck module" issue (#3813)
Adds some logging and times out lock acquisition attempts in the host
controller.

Should help debugging clockworklabs/SpacetimeDBPrivate#2337
2025-12-04 20:23:32 +00:00
Noa c2b8c7fc7f [TS] Implement TextEncoder/TextDecoder with native code (#3800)
# Description of Changes

This implements (a subset of) the TextEncoder/TextDecoder web APIs using
native functions to do the actual `Uint8Array <-> String` conversion.
This should be a good bit faster than the `fast-text-encoding` package.

# Expected complexity level and risk

2 - this introduces new kinds of JS code and host calls to the v8 host,
but they're pretty well encapsulated.

# Testing

- [x] All TS modules make use of these already for encoding/decoding
strings in BSATN - the `fast-text-encoding` polyfill we pull in only
takes effect if the classes don't already exist, so the smoketests
passing means it works.
2025-12-04 20:11:52 +00:00
Kim Altintop f458d418e5 smoketests: Adjust test_enable_disable_replication test (#3822)
This now can't rely on `replication_state` before enabling replication.
2025-12-04 18:55:38 +00:00
Mazdak Farrokhzad 55e0c99850 Store SubscriptionMetrics for Update, Subscribe, Unsubscribe in ModuleSubscriptions (#3821)
# Description of Changes

This showed up in flamegraphs, in particular for `Update`, so let's
cache the `SubscriptionMetrics`s.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

Covered by existing tests.
2025-12-04 18:36:56 +00:00
Shubham Mishra c99a6131c8 [Rust] Query builder Integration. (#3823)
# Description of Changes
Patch contain few different things, required to run query builder end to
end.
Git history seems messed up but it can be reviewed commitwise from -
69c1907b3e.

1. Decouples generic type `T` from table name, as type represents the
`struct` and not table, and there couple be multiple tables implemented
from same struct.
2. modify table macro implementaiton to generate code supporting
`traits` and types required for query builder,
3. Disable aliasing in sql queries for now, as it was causing
semantically wrong query when we were doing joins on `FromWhere` (as
original `Expr` were referencing to original table names).
4. smoketests.


# API and ABI breaking changes
Add `Query<T>` type as Views return type.


# Expected complexity level and risk
2, changes are simple but not splitted up well.

# Testing
1. Added smoketest.

TODO:
ui test.

---------

Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2025-12-04 17:45:29 +00:00
Noa 653a2a1bad Update wasmtime to v39 (#3818)
# Description of Changes

As discussed; could possibly improve performance/in general it's good to
keep up with patches, it's been over a year since we last bumped this.

# Expected complexity level and risk

2 - large, important dependency but wasmtime is very solid,
well-engineered software.

# Testing

- [x] smoketests run on wasmtime
2025-12-04 10:53:51 +00:00
joshua-spacetime 60048ecbdf [Rust] update module bindings to use new view abi (#3819)
# Description of Changes

Updates the rust module bindings to use new view abi
(`ViewResultHeader`) and updates the return codes for the
`__call_view__` and `__call_view_anon__` module exports. This is in
preparation for `Query` builder support.

# API and ABI breaking changes

Not breaking. Existing modules will continue to use the old abi. New
modules will use the new abi. However previous host versions will not
support modules built using this version of the bindings.

# Expected complexity level and risk

2

# Testing

This is an internal refactor. All existing tests should continue to
pass. The only tests that needed updating were the negative module
compilation tests because the error messages produced by rustc changed.
2025-12-04 08:28:41 +00:00
Shubham Mishra 51ec052509 [Rust] Module-side query builder types (#3797)
# Description of Changes

Implements a query builder for rust modules according to the
[spec](https://github.com/clockworklabs/SpacetimeDBPrivate/blob/master/proposals/0030-views.md#5-query-builder-for-incremental-evaluation).

Look at the tests in `query_builder.rs`.

TODO: Extend return type for views to include `Query` and update the
`#[table]` macro to generate query builder bindings.

# API and ABI breaking changes

This is an additive change. Current modules do not need to be updated
unless they wish to use the query builder.

# Expected complexity level and risk

1.5, Will appreciate comments to better structure code.

# Testing 

[x]: unit tests.

I have also done type safety checks manually from module.

---------

Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2025-12-04 06:53:26 +00:00
Jeffrey Dallatezza 9989416cd3 Update view ABI to support returning queries (#3685)
# Description of Changes

This adds some changes for how we return data from view functions.
Originally, we interpreted the output of a view function as a bsatn
encoding of an array of rows. Since we also want to be able to return
queries from view functions, we need to be able to return different
types too. At this point, this is effectively not a functional change,
since we don't use the new format, and we don't actually try to parse
the new format.

This introduces a new format for view returns, which is a
`ViewResultHeader`, potentially followed by additional data. For
example, if a view were returning rows directly, it would write a
`ViewResultHeader::RowData`, followed by an array of rows. Note that we
could have given that object a byte array with the rows instead of using
a header an a separate object, but that would force us create an extra
copy when encoding and when decoding.

To make this backward compatible with existing views, we have a
different way to return the new format. For v8 views, if they return a
byte array, we assume it is the old format. If they return an object, we
expect the `data` field of that object to be the actual return data.

For wasm views, we interpret a return code of 2 to mean that it uses the
new format.

On the host side, we handle this naively: we will perform the query, and
we will act as though the view has a read dependency on the tables in
the query. In follow up PRs we can make this more efficient.

# API and ABI breaking changes

This is not a breaking change, but it does make the ABI more complicated
(specifically to avoid breaking it).

# Expected complexity level and risk

1.5. This should not affect the existing return style.

# Testing

I've done manual testing of this with a version of the typescript
bindings that returns queries.
2025-12-03 19:56:41 +00:00
Jason Larabie 52d098dbfb Added and tested procedure docs for Unreal C++ & Unreal Blueprint (#3810)
# Description of Changes
Closes: #3781 
- Added and tested procedure docs for Unreal C++ & Unreal Blueprint
- Fixed a small issue with the blueprint accessors for the event status
- Fixed a bug in the C# procedure docs

# API and ABI breaking changes

N/A

# Expected complexity level and risk

1

# Testing

I built a new local test framework to do another clean end to end test
of procedures with Unreal to properly test the Blueprint work as well.

- [x] Built the Rust server alongside a new Unreal client and tested
each procedure/callback in C++ and Blueprint
- [x] Reviewed the docs locally
2025-12-03 19:47:25 +00:00
Zeke Foppa 141048cdd8 Bump versions to 1.11.0 (#3808)
# Description of Changes

Bumping versions to 1.11.0 in preparation for an upcoming release.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Existing CI passes

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-12-02 22:45:29 +00:00
Zeke Foppa 64aa808957 CI - Skip the Unity testsuite on external PRs (#3805)
# Description of Changes

Bubbling up an `if` since we split out the unity testsuite into its own
job.

The GitHub docs say
(https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks):
> A job that is skipped will report its status as "Success". It will not
prevent a pull request from merging, even if it is a required check.

# API and ABI breaking changes

None. CI-only change.

# Expected complexity level and risk

1

# Testing

Unsure how to test this honestly 🤷

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-12-02 21:09:52 +00:00
Noa 1ef025f501 [TS] Call registerType for procedure params (#3806)
# Description of Changes

An important fix I put in #3704 that's not in master anymore because it
was reverted.

# Expected complexity level and risk

1
2025-12-02 19:19:16 +00:00
Kilian Strunz 3cead3df6a [TS] Fix development exports breaking NextJS (#3796)
# Description of Changes

NextJS 15 and 16 do not build without these development exports removed
tho they funnily enough have different errors.
<img width="961" height="262" alt="image"
src="https://github.com/user-attachments/assets/1e7ad634-d68f-4af3-a07e-302d252b41e5"
/>

Upon removing the development export everything works like a charm.
I couldn't find any benefit of having them but maybe @cloutiertyler
knows more why those are there in the first place🤷

This can be reproduced if you clone this repo i set up:
https://github.com/kistz/spacetime-next-react-hooks
Since its a build error it shouldnt matter if you have the actual module
running somewhere.

Step 1: `bun install`

Step 2: `bun dev`

Step 3: observe that the error above is appearing (not good)

Step 3: Go into `node_modules/spacetimedb/package.json` 

Step 4: Remove the `development` fields under exports like in this pr

Step 5: `bun dev`

Step 6: Profit. (should only be a connection error (aka nothing renders)
at this point since the module your trying to connect to is missing)

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

Not a whole lot since i dont fully grasp the impact of this change but
without it i cant even use the `spacetimedb` package with NextJS and
removing them fixes it.
But even development scenarios are working just fine without it.

Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2025-12-02 18:28:06 +00:00
clockwork-tien 0c82b6559d Docs: Update docs nav height to 56px (#3788)
# Description of Changes

- Update docs nav height to 56px

## Screenshots:

<img width="1256" height="55" alt="image"
src="https://github.com/user-attachments/assets/df070fb2-f3c8-4f17-ae58-6a6aa72c8033"
/>

<!-- Please describe your change, mention any related tickets, and so on
here. -->

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [ ] <!-- maybe a test you want to do -->
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->
2025-12-02 15:48:45 +00:00
Mario Montoya 730d49972b Remove duplicate assertSql in smoke test (#3588)
# Description of Changes

Small cleanup of duplicate logic on smoke tests

# Expected complexity level and risk
1
# Testing
- [x] Run smoke tests

Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2025-12-02 08:23:15 +00:00
Cameron Hutchison 62e79fad95 C# Views - Use Name from ViewAttribute instead of Method Name (#3792)
C# Views - Use Name from ViewAttribute instead of Method Name

# Description of Changes

The [documentation for C#
views](https://spacetimedb.com/docs/modules/c-sharp#views) says that
"Views must be declared as Public, **with an explicit Name**, and
[...]". However, the `Name` provided to the `View` attribute is not
being used as the name of the view in the Module or the generated C#
client SDK code. The `ViewDeclaration` actually checks that the `View`
attribute's name is not null or empty, but then proceeds to do nothing
with it.

This PR updates the `ViewDeclaration` to use the `Name` property from
`ViewAttribute`.

For more info - see my bug report in Discord:
https://discord.com/channels/1037340874172014652/1443881580602069043

# API and ABI breaking changes

No breaking change to the API. Though, anyone who has a view name
declared that's different from their method name will have to deal with
that during migration of their modules.

# Expected complexity level and risk

1 - Trivial change

# Testing

I compiled the C# projects under `crates/bindings-csharp`, built the
NuGet packages, and tested them locally with a project using SpacetimeDB
1.10 (CLI and associated packages).

I confirmed that the generated classes now use the value from the `View`
attribute as the `RemoteTableName`. See attached image.

<img width="1429" height="372" alt="Screenshot 2025-11-28 at 3 04 48 PM"
src="https://github.com/user-attachments/assets/1db83c14-b0dc-4bcb-87ac-50e104f4d501"
/>

---------

Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2025-12-02 07:42:25 +00:00
Tyler Cloutier 5f1cb41eb9 Fixes docs links (#3803)
# Description of Changes

This removes all usages of `pathname:///` and replaces them with
`https://spacetimedb.com/`. `pathname:///` was resolving to `/docs` in
some cases and was not verified by our link checker. Note that this
means these links will NOT work in staging.

This is a temporary fix. We should find a way to be able to link out to
the rest of the site without hardcoding the hostname in the future.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- I tested that the links work locally (but obviously they link to the
production site).

---------

Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2025-12-02 07:30:49 +00:00
Tamaro Skaljic 87bc15c0b4 Implement DbContext for AnonymousViewContext and ViewContext (#3787)
# Description of Changes

The trait has already been implemented for ReducerContext and TxContext,
but implementation for AnonymousViewContext and ViewContext is still
missing.

## Background why I need this change

In SpacetimeDSL, I currently have the ReducerContext hard-coded as a
prerequisite for creating a DSL instance (see
https://github.com/tamaro-skaljic/SpacetimeDSL/blob/main/src/lib.rs#L9-L33)
.

With the addition of

- ViewContext,
- AnonymousViewContext,
- ProcedureContext, and
- TxContext,

I am now faced with the dilemma that I also have to support SpacetimeDSL
with the other contexts.

I hope to be able to use `spacetimedb::DbContext<DbView =
spacetimedb::Local>` and `spacetimedb::DbContext<DbView =
spacetimedb::LocalReadOnly>` as a common denominator.

(I signed the CLA)

# API and ABI breaking changes

No

# Expected complexity level and risk

1

Signed-off-by: Tamaro Skaljic <49238587+tamaro-skaljic@users.noreply.github.com>
Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2025-12-02 07:07:37 +00:00
joshua-spacetime 6cf2372a3c Remove race condition from sdk test (#3804)
# Description of Changes

Moves a reducer call to inside an `on_insert` callback to avoid race
condition.

# API and ABI breaking changes

None

# Expected complexity level and risk

0

# Testing

Fixes a test
2025-12-02 05:53:42 +00:00
joshua-spacetime c49eea31da Fix view rewrite for delta tables (#3801)
# Description of Changes

Applies the same implicit filter for views to delta tables that we
already did for physical tables.

Removes a single condition `scan.delta.is_none()` from the already
existing rewrite rule.

# API and ABI breaking changes

None

# Expected complexity level and risk

0

# Testing

- [x] Rust sdk test
2025-12-01 21:15:32 +00:00
Piotr Sarnacki 1fb8c28e9e Actually report reducer fuel used (#3799)
# Description of Changes

In the `call_reducer_with_tx` function we only reported the WASM fuel
used by view evaulation, but not the stats from the actual reducer call.
This PR fixes it and we now properly record it.

# Expected complexity level and risk

1

# Testing

I've tested the change locally. Before the change the reported metrics
were always zero after running any reducer. Now the usage is reported
properly.
2025-12-01 19:26:13 +00:00
Phoebe Goldman b5f3ce8c2d Add docs for procedures (#3766)
# Description of Changes

In the spirit of our planned move to concept-based documentation rather
than language-based documentation,
I've chosen to add a quick section to the overview, and then a new page
for documentation about procedures. I have not updated any tutorials or
reference pages.

# API and ABI breaking changes

N/a - docs

# Expected complexity level and risk

1 - docs

# Testing

None.

---------

Co-authored-by: Noa <coolreader18@gmail.com>
2025-11-27 05:00:03 +00:00
John Detter 4588f77599 Update typescript package size limits (#3786)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

I got these errors when I tried sending out the typescript NPM package:

```
  cjs (brotli)
  Package size limit has exceeded by 165 B
  Size limit: 26 kB
  Size:       26.16 kB brotlied
  
  esm (brotli)
  Size limit: 26 kB
  Size:       25.87 kB brotlied
  
  esm (gzip)
  Package size limit has exceeded by 536 B
  Size limit: 30 kB
  Size:       30.54 kB gzipped
  
  esm (uncompressed)
  Package size limit has exceeded by 3.77 kB
  Size limit: 160 kB
  Size:       163.77 kB
  
  esm min (brotli)
  Package size limit has exceeded by 194 B
  Size limit: 14 kB
  Size:       14.19 kB brotlied
  
  esm min (gzip)
  Package size limit has exceeded by 144 B
  Size limit: 16 kB
  Size:       16.14 kB gzipped
  
  esm min (uncompressed)
  Package size limit has exceeded by 1.29 kB
  Size limit: 65 kB
  Size:       66.29 kB
```

# API and ABI breaking changes

None

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

1

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] After this change I was able to publish the typescript NPM
package.
2025-11-27 02:50:45 +00:00
John Detter 1d3421745c Split Unity and C# tests into separate jobs (#3779)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

This has 2 benefits:
1. If the Unity test fails because of a license issue then we don't have
to re-run the C# tests again as part of this flow. Re-running the Unity
tests will be much faster if that's the only thing the job is doing.
2. These tests will run faster because they will now run in parallel as
separate CI jobs.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

1

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] Both tests pass

---------

Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-26 21:33:35 +00:00
Tyler Cloutier 1630f0c553 Fixes reported issues with the TypeScript SDK (#3737)
# Description of Changes

Fixes:

- [This
issue](https://discord.com/channels/1037340874172014652/1398209084699709492/1441556875647647816)
by exporting the `SubscriptionHandle` type with the `REMOTE_MODULE` type
applied.
- [This
issue](https://discord.com/channels/1037340874172014652/1398209084699709492/1441559246213746749)
by converting to `camelCase` for column names in code generation.
- Fixes an issue where `onMyReducer` callbacks were passing arguments as
variadic params, while the types indicated they would be passed as an
object. `onMyReducer((ctx, argA, argB, argC) => {})` vs
onMyReducer((ctx, { argA, argB, argC}) => {})`
- [Fixes an
issue](https://github.com/clockworklabs/SpacetimeDB/issues/3503#issuecomment-3566715928)
where the table type name was used instead of the table name in code
generation for constructing tables.
- [Fixes
issue](https://discord.com/channels/1037340874172014652/1398209084699709492/1441886030436499466)
with `ScheduleAt` being used in non-table types.
- [Fixes
issue](https://github.com/clockworklabs/SpacetimeDBPrivate/issues/2168)
where template projects do not use the correct lifecycle reducer setup

# API and ABI breaking changes

Adds a new export, and fixes casing in code genreation.

# Expected complexity level and risk

2

# Testing

- I have tested that the `SubscriptionHandle` is correctly exported
- I have tested that the constraint name is now output in `camelCase`
- I have tested that `onMyReducer` callbacks now return a single
argument
- I have tested that the table name (and view name) is now used instead
of the type name for code generation
- I have tested that the new lifecycle reducers correctly compile
2025-11-26 21:09:45 +00:00
Noa 7ca16de147 Fix some typescript issues (#3775)
# Description of Changes

Fixes https://github.com/clockworklabs/SpacetimeDBPrivate/issues/2169
and https://github.com/clockworklabs/SpacetimeDBPrivate/issues/2170.

# Expected complexity level and risk

1

# Testing

- [x] The issues no longer occur.

---------

Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
2025-11-26 21:08:47 +00:00
Phoebe Goldman d4c80b4de1 Delete duplicated docs folders (#3780)
# Description of Changes

Somehow (apparently after #3494) we wound up with a bunch of duplicate
folders in our repo, both the old title-case names and the new
lower-case names. All of the remaining files in the title-case
directories have their last change in #3343, well before #3494, so I
don't believe we're losing any intermediate changes by deleting them.
I'm not sure how this happened, but it seems to be an easy fix.


# API and ABI breaking changes

N/a

# Expected complexity level and risk

2 - some small possibility that I accidentally deleted an intentional
change that got borked by a merge conflict or something. I don't think I
did, tho, based on the age of the git blame on the files deleted here.

# Testing

None
2025-11-26 19:37:15 +00:00
John Detter 9c6e5a5cbe Set timeout for smoketests (#3772)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

Sets a 2 hour timeout for the smoketests. If the smoketests are taking
more than 2 hours they likely will never finish and we should just time
them out.

# API and ABI breaking changes

None

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

1

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x]
https://github.com/clockworklabs/SpacetimeDB/actions/runs/19697510980/job/56425630374?pr=3772
2025-11-26 19:08:49 +00:00
Phoebe Goldman ae9bd74eca Disable scheduling procedures (#3768)
# Description of Changes

We've been unable to get scheduled procedures into the initial release
of procedures due to a nondeterministic hang in some of our tests which
we don't have time to debug. As such, this commit disables scheduled
procedures by:

- Changing the `RawModuleDevV9` validator to reject scheduled
procedures.
- Changing the Rust bindings library's typechecking magic so that
scheduled table annotations referencing procedures will cause a type
error.
- Removes some docs from the Rust bindings library which reference
scheduled procedures.

# API and ABI breaking changes

N/a

# Expected complexity level and risk

1

# Testing

Automated tests should be sufficient.

Prior to merging #3774 , CI for this branch merged with master failed in
the intended way: modules which attempted to define scheduled procedures
failed to typecheck.
2025-11-26 18:40:25 +00:00
John Detter 0590f7022d Upgrade to version 1.10.0 (#3769)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

This upgrades the SpacetimeDB version to 1.10.0.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

1

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

This is just a version bump - not tested.
2025-11-26 17:55:26 +00:00
John Detter d26f3a10a9 Revert "Procedures: fix scheduling (#3704)" (#3774)
This reverts commit b2e37e8008.

# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

Reverts #3704 which I'm pretty sure contains some sort of bug which is
causing the smoketests to hang.

# API and ABI breaking changes

None

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

1

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] CI passing again
2025-11-26 17:06:11 +00:00
Tyler Cloutier dbc3d86b25 First pass at reorganizing the docs and making them nice (#3494)
# Description of Changes

This PR is the first in a series of PRs which are an effort the
reorganize the docs and make it easier for people to get started using
SpacetimeDB.

This PR:

1. Renames all folders to be `kebab-case`. This is because `docIds` are
set based on folder and file names, and there is no way to override that
within a file (all you can change with `id: my-id` is the last component
of the id. Because we want to be able to access docs in react components
we need stable predictable ids.
- This also necessitates setting up a few `_category_.json` files so
that the categories do not show up as kebab case in the sidebar.
2. Adds a few React components with images so it's clearer on how to get
started
3. Reorganizes the quickstarts to be at the top of the side bar and
simplifies the server and client into a single document named for the
language
4. Sets up redirections so the old links to the old documents now point
to the new documents
5. Copies the entirety of `typography.css` from the website into this
repo for the purpose of keeping them identical
6. Makes minor fixes and improvements to the contents of the docs

In a future PR, I intend to:

1. Add a tutorial section to the docs which will include two tutorials:
Blackholio and Chat
2. Turn the chat quickstart documents into the Chat tutorial and
consolidate it into a single file with different language switchers (if
this is feasible)
3. Create a new quickstart section, which has a quickstart guide for
each platform that we support so far, namely:
    - Vanilla TypeScript
    - Vanilla JavaScript
    - Vanilla Rust
    - Vanilla C#
    - React
    - Unity
    - Unreal
4. Update the quickstart guides to do the following (in the future I
will add more platforms with this scheme):
- Use `spacetime dev --template <framework-template>` to create a new
project for the given framework
    - Insert data into the database
    - Add a new `reducer` to the template
    - Add a new `table` to the template
    - Add a new `view` to the template
    - Call the reducer from the client
    - Subscribe to the `view` from the template
5. Break up the current per language module reference files into files
about SpacetimeDB concepts with a `TabGroup` for each language, namely:
    - Modules
    - Tables
    - Reducers
    - Procedures
    - Code generation
    - DbConnection (and the SDK API)
    - Auth
    - etc.
The idea being that we should explain our platform by concept, not by
language. This will also allow us to reuse a lot of prose that is
repeated in the different language documents.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Tested the documents locally to ensure that they render properly

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-26 15:06:02 +00:00
Mazdak Farrokhzad b2e37e8008 Procedures: fix scheduling (#3704)
# Description of Changes

Reworks how `SchedulerActor::handle_queued` works so that it first
determines the parameters of the call to a reducer or the parameters of
the call to the procedure. This also enables the removal of the special
case `call_scheduled_reducer`.

Fixes #3645.

# API and ABI breaking changes

None

# Expected complexity level and risk

2

# Testing

A test `schedule_procedure` is added.

---------

Co-authored-by: Noa <coolreader18@gmail.com>
Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>
Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
2025-11-26 03:56:53 +00:00
John Detter d7d06b1529 [Typescript] Increased size limits for some deps (#3728)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

We got some errors when publishing the typescript release related to the
size limits of these deps. This PR just increases those limits.

```
  cjs (brotli)
  Package size limit has exceeded by 348 B
  Size limit: 25 kB
  Size:       25.35 kB brotlied
  
  esm (brotli)
  Package size limit has exceeded by 5.19 kB
  Size limit: 20 kB
  Size:       25.19 kB brotlied
  
  esm (gzip)
  Package size limit has exceeded by 4.63 kB
  Size limit: 25 kB
  Size:       29.63 kB gzipped
  
  esm (uncompressed)
  Package size limit has exceeded by 8.45 kB
  Size limit: 150 kB
  Size:       158.45 kB
  
  esm min (brotli)
  Package size limit has exceeded by 1.65 kB
  Size limit: 12 kB
  Size:       13.65 kB brotlied
  
  esm min (gzip)
  Package size limit has exceeded by 490 B
  Size limit: 15 kB
  Size:       15.49 kB gzipped
  
  esm min (uncompressed)
  Package size limit has exceeded by 3.51 kB
  Size limit: 60 kB
  Size:       63.51 kB
  
  react esm min (brotli)
  Size limit: 10 kB
  Size:       4.13 kB brotlied
  
  react esm min (uncompressed)
  Size limit: 10 kB
  Size:       4.13 kB brotlied
  
  react esm min (gzip)
  Size limit: 15 kB
  Size:       4.64 kB gzipped
  
  sdk esm min (brotli)
  Package size limit has exceeded by 3.41 kB
  Size limit: 10 kB
  Size:       13.41 kB brotlied
  
  sdk esm min (gzip)
  Package size limit has exceeded by 251 B
  Size limit: 15 kB
  Size:       15.25 kB gzipped
  
  sdk esm min (uncompressed)
  Package size limit has exceeded by 3.41 kB
  Size limit: 10 kB
  Size:       13.41 kB brotlied
  
  Try to reduce size or increase limit in "size-limit" section of package.json
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.
Error: Failed to publish package to npm
Error: Process completed with exit code 1.
```

# API and ABI breaking changes

None

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

1 - This just fixes the release.

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

- I have not tested this because I want review before trying it on the
release.

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->
2025-11-26 01:12:09 +00:00
Noa 174f5286d3 [TS] Client-side procedure bindings (#3765)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

# Expected complexity level and risk

2

# Testing

- [x] The types for generated module bindings look right
- [ ] Actually test the client behavior (how?)
2025-11-26 00:59:51 +00:00
clockwork-tien 617499b7c3 Docs: Update docs nav items font weight to 600 (#3721)
# Description of Changes

- Update docs nav items font weight to 600

<!-- Please describe your change, mention any related tickets, and so on
here. -->

Screenshot:

<img width="1489" height="56" alt="image"
src="https://github.com/user-attachments/assets/175ef382-41a1-40ed-8a25-c38cc4e513f1"
/>

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [ ] <!-- maybe a test you want to do -->
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-25 22:08:29 +00:00
John Detter 66606d29bc Move docs tests to custom runner (#3699)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

Just moving more jobs to the custom runner.

|Test|Before|After|% Change|
|---|---|---|---|
|Docs - Build + Test|2m|1m|No change|
|Docs - Publish|2m|<2m|No change|

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

1 - This is very low risk

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

I ran a publish test and it worked just fine:
<https://github.com/clockworklabs/SpacetimeDB/actions/runs/19515454265/job/55865908554>

- [x] CI still passes

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-25 22:06:32 +00:00