Skip to content

[2.0 Breaking]: Remove sender field from [Reducer|View|Procedure]Context#4208

Merged
joshua-spacetime merged 3 commits intomasterfrom
joshua/breaking/sender-rust
Feb 5, 2026
Merged

[2.0 Breaking]: Remove sender field from [Reducer|View|Procedure]Context#4208
joshua-spacetime merged 3 commits intomasterfrom
joshua/breaking/sender-rust

Conversation

@joshua-spacetime
Copy link
Collaborator

Description of Changes

Makes the sender field on ViewContext private and exposes a sender() method. Does the same for ReducerContext and ProcedureContext.

The purpose of this change: So that the host can determine if/when a view invokes or reads the sender.

Currently, because sender is a field, the host assumes that it is always read. This means views must be materialized per client, even if the view doesn't actually depend on sender, resulting in data duplication.

The initial solution for this problem was AnonymousViewContext which doesn't have a sender field. The better solution is to make sender a method so that it can call into the host and record when it's actually invoked.

Note, this patch only updates the module API, so the current implementation does not change. ViewContext views are still duplicated across clients. Changing this requires a new host syscall and for sender() to invoke that syscall. This however is backwards compatible and can be done anytime after the module APIs for the other languages (C#, TypeScript, C++) are updated.

Also note that ReducerContext and ProcedureContext were updated purely for consistency. There are currently no plans to track reads of sender in these contexts.

API and ABI breaking changes

Breaks the rust module api.

Expected complexity level and risk

1

Testing

N/A

@joshua-spacetime joshua-spacetime force-pushed the joshua/breaking/sender-rust branch from 5720eb1 to feab78f Compare February 5, 2026 17:38
@joshua-spacetime joshua-spacetime changed the title [2.0 Breaking]: Remove sender field from [Reducer|View|Procedure]Context (#4101) [2.0 Breaking]: Remove sender field from [Reducer|View|Procedure]Context Feb 5, 2026
@joshua-spacetime joshua-spacetime force-pushed the joshua/breaking/sender-rust branch from c03927b to d771a00 Compare February 5, 2026 21:42
@joshua-spacetime joshua-spacetime added this pull request to the merge queue Feb 5, 2026
Merged via the queue into master with commit 5da08a3 Feb 5, 2026
30 of 32 checks passed
@joshua-spacetime joshua-spacetime deleted the joshua/breaking/sender-rust branch February 5, 2026 23:53
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.

2 participants