Skip to content

refactor(notes): use non-monotonic ULIDs for note ids#478

Open
NickAldewereld wants to merge 1 commit into
CorentinTh:mainfrom
NickAldewereld:refactor/non-monotonic-note-ids
Open

refactor(notes): use non-monotonic ULIDs for note ids#478
NickAldewereld wants to merge 1 commit into
CorentinTh:mainfrom
NickAldewereld:refactor/non-monotonic-note-ids

Conversation

@NickAldewereld

Copy link
Copy Markdown

generateId() uses ulidFactory(), which defaults to monotonic: true. In monotonic mode, ids minted within the same millisecond are a deterministic +1 of the previous random suffix rather than fresh randomness.

Note ids are used as capability identifiers, not for sorting, so there's no reason to trade away entropy. Passing { monotonic: false } keeps the full 80 bits of randomness per id. Small, self-contained change.

In monotonic mode, ids minted within the same millisecond are a
deterministic +1 of the previous random suffix rather than fresh entropy.
Sortability isn't needed for a capability id, so keep the full 80 bits of
randomness per id.
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

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