fix: 8-char hex note IDs with a retroactive re-ID migration - #138
Merged
Conversation
newId() now emits 8 lowercase hex chars (32 bits; parseInt(id,16) gives a
single integer, MAC-address style). A boot-time migration re-IDs any note
that predates the convention — old 12-char ids and GK-import ids — to a
fresh 8-char id, moving its note_versions in the same transaction. It's
idempotent (no-op once all ids match ^[0-9a-f]{8}$) and resumable.
Guest localId() and the Google-Keep import id are 8 hex too; the import
id stays a deterministic hash slice so re-imports still dedupe.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
newId()→ 8 lowercase hex chars (32 bits;parseInt(id, 16)→ a single integer, MAC-address style, no separators).ready(): re-IDs any note not matching^[0-9a-f]{8}$(old 12-char ids, GK-import ids) to a fresh 8-char id, moving itsnote_versionsin the same transaction. Idempotent + resumable; a per-row failure is logged, not fatal.localId()and the Keep-import id are 8 hex as well (import id stays a deterministic hash slice so re-imports still dedupe).Notes
/note/<id>deep links to old ids change; public share links (/p/<token>) are unaffected.Test plan