Repository navigation
ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (4/6) - #1632
Open
sid597 wants to merge 2 commits into
Conversation
- relationInstanceToCrossApp takes each end's id from referenceIdOf (renamed from sourceDocumentIdOf and exported) instead of casting frontmatter.importedFromRid. - Drop the importedFromRid spread for relation instances: sync skips imported relations before they reach relationInstanceToLocalConcept. - Drop the author test that the pinned sync rows already cover, and rename the relation test helper so it no longer shadows conceptFor.
|
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.
relationInstanceToCrossAppand the sharedcrossAppRelationToDbConcept. After this PR, every row Obsidian sync sends comes from a shared converter.space_id,is_schema: falseor an emptyliteral_content, andauthor_idbecomesauthor_local_id.upsert_conceptssetsspace_idfromv_space_id, defaults the other two and resolvesauthor_local_idto the same account. This comes from readingconcept.sql. The unit tests mock the RPC.authorIdsendsauthor_idand noauthor_local_id, becauseupsert_conceptsletsauthor_local_idoverrideauthor_id. Sync only sees such a relation when an accepted imported relation has noimportedFromRid.nameis set after the converter. The shared converter names a relation by local ids. Obsidian keeps[[source title]] -label-> [[destination title]], andCrossAppRelationhas no name field.sourceDocumentIdOfinsourceSlot.tsis exported asreferenceIdOf. A relation end uses it: the note's origin RID for an imported note, itsnodeInstanceIdotherwise.syncDgNodesToSupabase.ts:876), so relation rows no longer carry animportedFromRidbranch that could never run. ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (1/6) #1620 pins that an imported relation isn't sent.importedFromRidis not a string, a relation end now sends the note's local id. Before, the value was sent as it was andupsert_conceptsfailed the row. Read from the code, not run.space_id,is_schema: false,literal_content: {}upsert_conceptsauthor_id: authorId ?? context.userIdauthor_idwhen the relation has one, elseauthor_local_idsource_local_id,schema_represented_by_local_id,created,last_modifiedlocal_reference_contentendsreferenceIdOfnameVerification
apps/obsidianon this head:vitest runpasses (260 tests),tsc --noEmit --skipLibCheckpasses, and prettier is clean on the changed files.referenceIdOfalways return the local id fails five tests, including "points a relation at an imported note by the note's origin RID, at either end".eslint --max-warnings 0on the changed files reports two warnings this PR didn't add, atsyncDgNodesToSupabase.ts:1152and:1157(from [ENG-1178] Automatic local remote sync nodes relations #706).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 relation end on a note whose frontmatterimportedFromRidis not a string sends the note's local id. Before, the row failed.referenceIdOfin place of two casts on untyped frontmatter.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.