Skip to content

Async IDC: Local Outbox - #6377

Draft
Shubham8287 wants to merge 11 commits into
masterfrom
shub/idc-source-receiver-references
Draft

Shubham8287 wants to merge 11 commits into
masterfrom
shub/idc-source-receiver-references

Conversation

@Shubham8287

@Shubham8287 Shubham8287 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Description of Changes

Based on #6376.

API and ABI breaking changes

Rollback safety impact

Expected complexity level and risk

Testing

@Shubham8287
Shubham8287 marked this pull request as draft October 25, 2026 20:13
@Shubham8287
Shubham8287 force-pushed the shub/idc-source-receiver-references branch 3 times, most recently from 2de1197 to 41f6ff1 Compare October 26, 2026 14:18
@Shubham8287 Shubham8287 changed the title async IDC: source receiver references Async IDC: source receiver references Oct 26, 2026
@Shubham8287
Shubham8287 force-pushed the shub/idc-rust-outbox-macro-split branch from e657762 to 9d87560 Compare October 27, 2026 14:55
@Shubham8287 Shubham8287 changed the title Async IDC: source receiver references Async IDC: Local Outbox Oct 27, 2026
@Shubham8287
Shubham8287 force-pushed the shub/idc-source-receiver-references branch from 742eb67 to 32401dd Compare October 27, 2026 16:57
@Shubham8287
Shubham8287 force-pushed the shub/idc-rust-outbox-macro-split branch from 2a2be07 to 64a3a96 Compare October 28, 2026 11:34
@Shubham8287
Shubham8287 changed the base branch from shub/idc-rust-outbox-macro-split to master October 29, 2026 11:23
@Shubham8287
Shubham8287 force-pushed the shub/idc-source-receiver-references branch from 32401dd to ed66d62 Compare November 28, 2026 07:31
A TypeScript module can now send to a reducer in its own module without
generating receiver bindings for itself. The table declares
`outbox: 'local'`, and the receiving reducer names it with
`receiverFor`, as `onSchedule` and `onResult` name their tables.
Declaring the link on the reducer avoids a type cycle between the table
and a reducer that uses the schema containing it.

When the schema is built, the receiver's parameters are mapped to columns
by name or `.param({ name })` and checked by type. The module emits a
`LocalOutboxes` entry with the reducer's source name, and the host
resolves the canonical name and signature hash. The section is omitted
from modules without a local outbox, so they still load on hosts that
predate it.
A C# outbox table can now call a reducer of its own module. Set
Outbox to the class declaring the reducer and OutboxReducer to its
name:

    [Table(Accessor = "PingOutbox", Outbox = typeof(Module),
           OutboxReducer = nameof(Module.ReceivePing))]

[Outbox(typeof(Module), ReducerName = nameof(Module.ReceivePing))]
declares the columns the same way it does for receiver bindings.

The generator checks the columns against the reducer's parameters at
compile time, as it does for generated receivers, and emits a
RawLocalOutboxDefV10 with the reducer's source name and the argument
columns in parameter order. The host resolves the name and computes the
signature hash, so the module computes no hash. A local outbox's target
column is a SpacetimeDB.Identity, and [OnResult] works as for remote
outboxes.
Run the self-outbox scenario, which sends a nested message from a module
to its own reducer without receiver bindings, against TypeScript and C#
ports of the Rust fixture. Fixture setup for Rust, TypeScript and C#
moves out of `IdcTest` so this test can share it.
@Shubham8287
Shubham8287 force-pushed the shub/idc-source-receiver-references branch from ed66d62 to 8749b00 Compare November 28, 2026 09:05

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant