Make ctx.new_guid() return a standard UUID v4#26
Merged
Conversation
generate_guid() derived its value from SystemTime nanoseconds plus a thread-local counter, which produced low-entropy, structured output (the leading groups were always zero and the rest was largely sequential). Switch to uuid::Uuid::new_v4(). The value is still recorded in history, so replay stays deterministic.
78e0389 to
ebe12b1
Compare
Existing test_new_guid and test_new_guid_as_activity_input_replays_correctly already cover uniqueness and replay; the removed test mostly asserted uuid crate behavior.
- Reword residual 'deterministic GUID' doc references to 'random/replay-safe'. - Restore a minimal UUID v4 structural guard in test_new_guid so a revert to the old predictable scheme would be caught. - Generate SQLite provider lock tokens with uuid::Uuid::new_v4() instead of nanos + pid.
pinodeca
reviewed
Jun 5, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
affandar
approved these changes
Jun 8, 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.
generate_guid()built its value fromSystemTimenanoseconds plus a thread-local counter, which produced low-entropy, structured output — the leading groups were always zero and the remainder was largely sequential. This switches touuid::Uuid::new_v4().new_guid()was already a regular activity whose result is recorded in history, so determinism comes from that recorded value, not from how it's generated. Replay is unaffected.