ENG-1842 Strip block uids from stored templates to fix template editing#1119
Open
sid597 wants to merge 1 commit into
Open
ENG-1842 Strip block uids from stored templates to fix template editing#1119sid597 wants to merge 1 commit into
sid597 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
sid597
commented
Jun 10, 2026
| type RoamNode = { | ||
| text: string; | ||
| children?: RoamNode[]; | ||
| uid?: string; |
Collaborator
Author
There was a problem hiding this comment.
Why removing uid here fixes ENG-1842:
- RoamNodeSchema is only used for DiscourseNodeSchema.template
- The optional uid let migration store legacy template trees with their block uids in block props
- ENG-1454: Base getter() task #828's Template panel seeds an ephemeral buffer from that stored template → create-block replays the old uids → Block already exists (the originals still live under legacy Template) → buffer never created → panel dead. Shipped in v0.19.0, hence "suddenly broken"
- Nothing reads template uids from the store: panel save (serializeBlockTree) and createBlocksFromTemplate (stripTemplateUids) both strip them already
- Zod drops unknown keys on parse, so removal fixes both directions:
- read: already-poisoned graphs get clean templates immediately, no data migration
- write: future migrations store uid-free
- Alternative was stripping in EphemeralBlocksPanel, but that patches one consumer and leaves the next one to hit the same landmine
- Legacy mode (flag off) reads the live block tree and never touches this schema; fresh graphs were never poisoned
mdroidian
approved these changes
Jun 12, 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.
https://www.loom.com/share/1b3e8dc6a66c4528a3a7f6eba5f6c2b2