Repository navigation
ENG-1986 Refactor Obsidian sync to use the new cross-app schemas (2/6) - #1630
Conversation
- Set only the null template_content after crossAppNodeSchemaToDbConcept; CrossAppNodeSchema.template already carries a template's text. - Make the comment on the values set after the converters self-contained. - Give the Source fixture the empty template a new node type starts with. - concept_design.md: Obsidian now builds schema rows through the converter.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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. |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
crossAppNodeSchemaToDbConcept,crossAppRelationTypeSchemaToDbConcept,crossAppRelationTripleSchemaToDbConcept). The newobsidianToCrossAppConverters.tsis Obsidian's counterpart to Roam'sroamToCrossAppConverters.ts.space_idis no longer sent, andauthor_idbecomesauthor_local_id.upsert_conceptssetsspace_idfromv_space_id(concept.sql:476) and resolvesauthor_local_idto the account sync created for the sameaccountLocalId(concept.sql:403-405,supabaseContext.ts:83-108). This comes from reading the SQL. The unit tests mock the RPC.conceptConversion.tssets five values after the shared converters, because the CrossApp types have no field for them:description, anulltemplate_contentfor a type with no template,source_data,importedFromRid, and the triple'sname.nulltemplate_contenthas to stay. A full sync sends a node type again when its row lacks the key (syncDgNodesToSupabase.ts:744-773).as Record<string, Json>casts inconceptConversion.ts. Each shared converter buildsliteral_contentas an object literal, butLocalConceptDataInputtypes it asJson. Narrowing that type is apackages/databasechange outside this PR.apps/roam/src/utils/syncDgNodesToSupabase.ts:692). No ticket covers moving it yet.space_id: context.spaceIdv_space_idauthor_id: context.userIdauthor_local_idname,source_local_id,is_schema,created,last_modifiedliteral_contentlabel,format,template,roles,complementliteral_content.template_contentnullset aftername,description,source_data,importedFromRiddiscourseRelationTypeToLocalConcept(context, relationType)({ accountLocalId, relationType })Verification
apps/obsidianon this head:vitest runpasses (258 tests),tsc --noEmit --skipLibCheckpasses, and prettier is clean on the changed files.|| undefinedfromtemplateTitleinnodeTypeToCrossAppfails "sends template_content null for a node type with no template".eslint --max-warnings 0on the changed files reports twono-unnecessary-type-assertionwarnings, atsyncDgNodesToSupabase.ts:1155and:1160. Both lines date from [ENG-1178] Automatic local remote sync nodes relations #706 and this PR doesn't touch them.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: None.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.