-
Notifications
You must be signed in to change notification settings - Fork 5
[ENG-1181] Sync node relation definitions #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: eng-1178-f9-automatic-local-remote-sync-nodes-relations
Are you sure you want to change the base?
[ENG-1181] Sync node relation definitions #707
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
📝 WalkthroughWalkthroughThis PR introduces relation-type and relation-schema conversion helpers for building LocalConceptDataInput, updates node conversion to include full node data in literal_content, and refactors the Supabase sync pipeline to accept plugin parameters, build schema lookups, and implement a two-step upsert process for nodes and relation concepts. Changes
Sequence DiagramsequenceDiagram
participant Plugin as Obsidian Plugin
participant SyncFn as syncChangedNodesToSupabase
participant ConvertFn as convertDgToSupabaseConcepts
participant SupabaseAPI as Supabase RPC API
Plugin->>SyncFn: plugin, context, changedNodeIds
SyncFn->>SyncFn: upsertNodesToSupabaseAsContentWithEmbeddings
SyncFn->>SupabaseAPI: upsert node content + embeddings
SupabaseAPI-->>SyncFn: nodes upserted
SyncFn->>ConvertFn: plugin, changed nodes
ConvertFn->>ConvertFn: build nodeTypesById, relationTypesById lookups
ConvertFn->>ConvertFn: discourseNodeSchemaToLocalConcept (nodes)
ConvertFn->>ConvertFn: discourseRelationTypeToLocalConcept (relation types)
ConvertFn->>ConvertFn: discourseRelationSchemaToLocalConcept (relations)
ConvertFn-->>SyncFn: LocalConceptDataInput array
SyncFn->>SupabaseAPI: upsert_concepts (ordered set)
SupabaseAPI-->>SyncFn: concepts upserted
SyncFn-->>Plugin: sync complete
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
97b3983 to
777b079
Compare
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.