Skip to content

ENG-839: Guard incomplete relation types in canvas#1095

Open
trangdoan982 wants to merge 4 commits into
mainfrom
eng-839-canvas-error-when-making-a-relation
Open

ENG-839: Guard incomplete relation types in canvas#1095
trangdoan982 wants to merge 4 commits into
mainfrom
eng-839-canvas-error-when-making-a-relation

Conversation

@trangdoan982
Copy link
Copy Markdown
Member

@trangdoan982 trangdoan982 commented May 28, 2026

https://www.loom.com/share/3977b131b059477595abae91916662f8

Summary

  • Prevent canvas relation creation from crashing when relation/node config is missing or stale.
  • Block using incomplete relation types (missing label/complement/source/destination) and show actionable warnings.
  • Disable saving incomplete relations in settings and filter incomplete relations from the relation dropdown.

Test plan

  • In Roam canvas, attempt to create a relation when:
    • no relations exist
    • the selected relation type has missing required fields
    • node types referenced by relations were deleted/recreated
  • Confirm: no crash; warning toast appears; settings link works; normal creation still works.

Made with Cursor


Open in Devin Review

Prevent crashes and confusing warnings when relation definitions are missing required fields, and guide users to settings to fix relation configuration.

Co-authored-by: Cursor <cursoragent@cursor.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 28, 2026

ENG-839

@supabase
Copy link
Copy Markdown

supabase Bot commented May 28, 2026

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment thread apps/roam/src/components/canvas/DiscourseRelationShape/DiscourseRelationTool.tsx Outdated
@trangdoan982 trangdoan982 requested review from mdroidian and removed request for mdroidian May 28, 2026 04:25
Referenced node tools are keyed by action names, not relation labels, so the incomplete-relation check never ran there.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/roam/src/components/canvas/overlays/RelationTypeDropdown.tsx
Skip relations with "?" source/destination/complement values so the dropdown matches relation tool validation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@trangdoan982 trangdoan982 requested a review from mdroidian May 28, 2026 04:33
Copy link
Copy Markdown
Member

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's either

  • change where we set "?" to "" and double check that doesn't break anything (then remove the "?" check

or

  • Write this check in one place DRY, so that when we do remove the "?" in the future that we don't need to change it in multiple places

Also, I don't think relation.complement is ever set to "?"

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.

2 participants