ENG-1955 Full migration to discourse relation shape#1167
Conversation
PR size/scope checkThis PR is over our review-size guideline.
Please split this into smaller PRs unless there is a clear reason the changes need to land together. If keeping it as one PR, please add a brief justification covering:
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da09f94deb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ? createLegacyDiscourseNodeShapeUtils(allNodes) | ||
| : []), | ||
| ...createAllRelationShapeUtils(allRelationIds), | ||
| ...createAllRelationShapeUtils(), |
There was a problem hiding this comment.
Keep legacy relation types in Cloudflare schemas
For Cloudflare sync rooms that already contain pre-migration relation arrows, the worker keeps serving records whose shape.type is the old relation id because its schema is built from customShapeTypes and it does not run this app's createMigrations. This helper now registers only discourse-relation while the Cloudflare path only preserves legacy node utils, so those old relation records are applied to the client store without a matching shape util and the canvas fails to hydrate. Keep the old relation shape utils/types for the Cloudflare adapter until rooms are migrated.
Useful? React with 👍 / 👎.
Canvas relation shapes previously used the relation block UID as the tldraw shape
type. That made relation records graph-specific and brittle: if the relation type was deleted, missing from another graph, or copied across platforms, tldraw could fail to recognize the shape and break the canvas.This migration moves all canvas relations to a single
discourse-relationshape type and stores the actual relation subtype inprops.relationTypeId. With one stable shape type, canvases can load gracefully even when the subtype is unknown, deleted, or from a different graph.This also makes cross-graph and cross-platform tldraw sharing easier because the canvas record format no longer depends on graph-local relation UIDs as shape types.
Manual Test Checklist
Baseline Setup
Supports/Supported By.auto canvas relationsenabled and disabled.Existing Canvas Migration
typeis a relation id.discourse-relationwithprops.relationTypeId.Add Source/ referenced-node relation tools are not accidentally migrated into canonical discourse relations.Cloudflare Sync
invalidRecorderror appears.New Relation Creation
discourse-relation, not the relation id.props.relationTypeIdis set to the selected relation id.Relation Editing
relationTypeIdremain valid.Auto Canvas Relations
discourse-relation.Roam Persistence
Export / Sharing
discourse-relationarrows.Cross-Graph / Missing Schema Cases
Analytics / Instrumentation
discourse-relation.Regression Smoke Test
invalidRecorderrors.