Skip to content

ENG-1984 Define cross-app schema contracts#1193

Open
maparent wants to merge 1 commit into
mainfrom
eng-1984-define-cross-app-schema-contracts
Open

ENG-1984 Define cross-app schema contracts#1193
maparent wants to merge 1 commit into
mainfrom
eng-1984-define-cross-app-schema-contracts

Conversation

@maparent

@maparent maparent commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

@linear-code

linear-code Bot commented Jul 6, 2026

Copy link
Copy Markdown

ENG-1984

@supabase

supabase Bot commented Jul 6, 2026

Copy link
Copy Markdown

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 ↗︎.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
discourse-graph Ready Ready Preview, Comment Jul 6, 2026 2:57pm

Request Review

@maparent maparent changed the base branch from main to eng-1987-align-cross-app-node-content-contract-with-database-schema July 6, 2026 02:26

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Base automatically changed from eng-1987-align-cross-app-node-content-contract-with-database-schema to main July 6, 2026 11:53
@maparent maparent force-pushed the eng-1984-define-cross-app-schema-contracts branch from 562c561 to f1e49e1 Compare July 6, 2026 14:56
Comment on lines +39 to +45
export type CrossAppRelationTripleSchema = CrossAppBase & {
label: string;
complement: string;
relation?: Ref | CrossAppRelationTypeSchema;
sourceType: Ref;
destinationType: Ref;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Data consistency issue: CrossAppRelationTripleSchema has redundant label and complement fields that conflict with the optional relation field of type CrossAppRelationTypeSchema, which also contains label and complement. This creates ambiguity about which values should be authoritative.

When relation is provided, there are now two sources of truth for label and complement, which can diverge and cause data inconsistency. Consider one of these approaches:

// Option 1: Remove redundant fields, require relation reference
export type CrossAppRelationTripleSchema = CrossAppBase & {
  relation: Ref | CrossAppRelationTypeSchema;
  sourceType: Ref;
  destinationType: Ref;
};

// Option 2: Make fields conditional based on relation presence
export type CrossAppRelationTripleSchema = CrossAppBase & (
  | { relation: Ref | CrossAppRelationTypeSchema; sourceType: Ref; destinationType: Ref; }
  | { label: string; complement: string; sourceType: Ref; destinationType: Ref; }
);
Suggested change
export type CrossAppRelationTripleSchema = CrossAppBase & {
label: string;
complement: string;
relation?: Ref | CrossAppRelationTypeSchema;
sourceType: Ref;
destinationType: Ref;
};
export type CrossAppRelationTripleSchema = CrossAppBase & (
| {
relation: Ref | CrossAppRelationTypeSchema;
sourceType: Ref;
destinationType: Ref;
}
| {
label: string;
complement: string;
sourceType: Ref;
destinationType: Ref;
}
);

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

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