Repository navigation
ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (3/6) - #1631
Open
sid597 wants to merge 2 commits into
Conversation
- nodeInstanceToCrossApp reads nodeInstanceId and nodeTypeId from ObsidianDiscourseNodeData instead of casting the cached frontmatter. - Drop the importedFromRid spread for node instances: sync skips imported notes before they reach discourseNodeInstanceToLocalConcept. - Rename buildNodeContentsWithEmbeddings to buildChangedNodeContent. - The converter comment now covers every row, not only schemas.
|
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 16, 2026
This branch was previously deployed
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.
Reviewer brief
ENG-1986 moves Obsidian sync off its own converters and onto the shared CrossApp converters, without loss of functionality. It ships as six PRs. PRs 1 to 4 and 6 are stacked on #1575 (ENG-1823). PR 5 targets
main:upsert_conceptstoday. No production change.colorbecomes a CrossApp field on node types and relation types, inpackages/database. It doesn't depend on PRs 1 to 4.colorthrough the shared converters. It needs PR 5, and its branch carries PR 5's change until that merges.Why six and not one: each step changes one kind of row, and #1620's tests show whether a stored value changed. PR 5 changes the shared contract, so it goes first in its own PR and needs its own review. Together the steps are well over the 400-line guideline.
directandfullContent withnodeInstanceToCrossAppand the sharedcrossAppNodeToDbConcept, the converter Roam sync already uses.space_idoris_schema: false, andauthor_idbecomesauthor_local_id.upsert_conceptssetsspace_idfromv_space_id, defaultsis_schemato false and resolvesauthor_local_idto the same account. This comes from readingconcept.sql. The unit tests mock the RPC.CrossAppNode.content.directis required, so the converter always returns adirectContent. Sync sendsdirectonly when the title changed, as before, soconceptConversion.tsdrops it otherwise.fullneeds no filter: it is set only when the note's text changed.conceptConversion.tssets these values after the converter, because the CrossApp types have no field for them:name(the file path),literal_content.label,literal_content.source_data, and each Content'screator_local_idandmetadata.buildNodeContentsWithEmbeddingsis nowbuildChangedNodeContent. It returns each changed node's title embedding and text, andnodeInstanceToCrossAppbuilds the Content. The embedding model comes from the shared converter's default,openai_text_embedding_3_small_1536, the value the removedEMBEDDING_MODELheld. The removed empty-input early return guarded nothing: with no nodes, no file is read and no request is sent.syncDgNodesToSupabase.ts:504), so node rows no longer carry animportedFromRidbranch that could never run.nodeInstanceIdduring a sync is now sent on that sync. Before, the id was read from the cached frontmatter, which doesn't have it yet, so the row was dropped and sent on the next sync. Run on both builds against a local database: the base build sent the new note on the next sync, and this PR's build on the same one. It applies only to a node created with no other note open. With a note open, the plugin creates a relation to it, which gives the new note its id at creation, and both builds send it on the same sync.console.errorcalls in the rewritten catch blocks are kept as they were.space_id,is_schema: falseupsert_conceptsauthor_id: context.userIdauthor_local_idgetNodeExtraDatatimes fromfile.statcreatedAt,modifiedAtfrom the times sync read at change detectionsource_local_id,schema_represented_by_local_id,core_title, the Source slotname,label,source_datadirectandfullContent rowscreator_local_idandmetadataVerification
apps/obsidianon this head:vitest runpasses (259 tests),tsc --noEmit --skipLibCheckpasses, and prettier is clean on the changed files.eslint --max-warnings 0on the changed files reports three warnings this PR didn't add:syncDgNodesToSupabase.ts:1152and:1157(from [ENG-1178] Automatic local remote sync nodes relations #706) and an unusedeatupsertNodesAsContentWithEmbeddings.ts:33.pnpm ci:validatefor the whole repository, and a sync against a database.Loom video
Not recorded yet.
Scope check
$scope-checkagainst ENG-1986 and the final diff.Done When: A note that gets itsnodeInstanceIdduring a sync (a node created with no other note open) is sent on that sync, not the next one.CrossAppNode.localIdis required. The old read cast the id from cached frontmatter and hid a missing value.Standards check
$dg-pr-adherence-checkagainst the final diff and PR metadata.Local delegated full review
$dg-delegated-full-reviewwhen no other full-review workflow is available.