ENG-1856 Store source identity metadata for Roam imported nodes#1218
Open
sid597 wants to merge 1 commit into
Conversation
|
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. |
Collaborator
Author
|
@codex review |
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.
Summary
discourse-graph.importedFromsourceNodeRidas the canonical cross-app identity and keepsourceModifiedAtas refresh stateWhy
Roam needs a stable way to recognize an imported shared node after its page title or content changes. Matching by display title would make duplicate prevention and refresh dependent on presentation and namespace decisions.
Obsidian already uses
importedFromRidas the canonical imported identity and stores the imported source timestamp aslastModified. This implementation follows the same boundary in Roam:sourceNodeRidis the identitysourceModifiedAtis refresh stateThis supersedes the closed v1 PR, #1161, and addresses its review feedback about the redundant six-field identity shape.
Implementation
The metadata is stored in page/block props rather than page content:
Writing merges the existing
discourse-graphobject so unrelated metadata, including relation migration state, survives. Content replacement during import or refresh does not touch these block props.The helper exposes:
Dependency
This PR is intentionally stacked on ENG-2019 / #1216, which is itself stacked on ENG-1855. ENG-1855 introduced the Roam discovery consumer and ENG-2019 extracted the cross-space listing logic while leaving already-imported detection app-side.
Once #1216 merges, this PR can be retargeted to
mainwithout changing the ENG-1856 implementation diff.Validation
pnpm --filter roam test -- src/utils/__tests__/importedSourceIdentity.test.ts src/utils/__tests__/discoverSharedNodes.test.tspnpm --filter roam check-typesgit diff --checkThe local shell reports Node 20 while the repository declares Node 22+, but all checks above completed successfully.