docs: Fix incorrect Math.random() note in reducer context#4667
Open
clockwork-labs-bot wants to merge 1 commit intomasterfrom
Open
docs: Fix incorrect Math.random() note in reducer context#4667clockwork-labs-bot wants to merge 1 commit intomasterfrom
clockwork-labs-bot wants to merge 1 commit intomasterfrom
Conversation
TypeScript modules use ctx.random (a deterministic RNG on the context), not Math.random(). The old note incorrectly stated that Math.random() was automatically seeded by SpacetimeDB. Changes: - Remove Math.random() from the warning about non-deterministic RNGs - Replace the incorrect note with a proper table row documenting ctx.random in the TypeScript context properties reference - Apply same fixes to versioned docs (v1.12.0)
cloutiertyler
approved these changes
Mar 19, 2026
clockwork-labs-bot
added a commit
that referenced
this pull request
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per Joshua: the note about
Math.random()in the reducer context docs is out of date and incorrect. TypeScript modules should usectx.randominstead.Changes:
Math.random()from the warning about non-deterministic RNGs (it was listed alongside C#'sRandomas something to avoid):::noteblock with a proper table row documentingctx.randomin the TypeScript context properties reference