ENG-2247 Copy a node's assets and rewrite its markdown for Roam - #1429
Open
maparent wants to merge 2 commits 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. |
maparent
added this pull request to stack #1430
September 10, 2026 14:43
maparent
force-pushed
the
eng-2247-copy-a-nodes-assets-and-rewrite-its-markdown-for-roam
branch
from
September 10, 2026 15:46
284bd2a to
8897117
Compare
maparent
force-pushed
the
eng-2247-copy-a-nodes-assets-and-rewrite-its-markdown-for-roam
branch
from
September 10, 2026 20:45
8897117 to
e278641
Compare
maparent
force-pushed
the
eng-2247-copy-a-nodes-assets-and-rewrite-its-markdown-for-roam
branch
from
September 10, 2026 21:40
e278641 to
6208fe4
Compare
maparent
force-pushed
the
eng-2247-copy-a-nodes-assets-and-rewrite-its-markdown-for-roam
branch
from
September 10, 2026 22:07
6208fe4 to
d650f4b
Compare
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
This creates a utility function, importAssetNodes, that ties together rewriteAssetLinks (ENG-2217) and mirrorAssetToRoamStorage (ENG-2218) to actually import the nodes detected in given markdown.
This also involves a refactoring of a repeated and defective utility function.
Finally, this includes some end-to-end tests (in a separate commit) that rely on importAssetNodes.
Verification
Includes unit tests.
Behaviour tests in #1401
Loom video
https://www.loom.com/share/f941f20853444597931d85d6b56ef68c
Scope check
$scope-checkagainst the ENG ticket and final diff.Done When: None. ENG-2247's criteria were written after the split, sothey describe this diff by construction. The list below measures against the original
ENG-2219
Done When, which is what was agreed before the split.Beyond the original ENG-2219 scope:
The tokenizer API.
rewriteAssetLinksexportslookupCandidatesand gainscollectAssetLocators, so the stage copies only references the rewriter can resolve.locator no longer appears in the fetched markdown once frontmatter and the title
heading are stripped. A Roam upload is a permanent charge on the user's storage, so
this is reachable the moment the stage ships. Deriving the spellings forward instead
does not work: a note writes
fig#1.pngasfig%231.png, andencodeURIleaves#alone.parseMatch, which this depends on, went to ENG-2217 as a pure refactor.getErrorMessageconsolidated intoapps/roam/src/utils/getErrorMessage.ts,replacing the copies in
materializeSharedNodeand inmirrorAssetToRoamStorage(anENG-2218 file), plus a branch for the
{ message }objects Supabase returns.importNodeAssetswould have satisfied theticket. This is cleanup, and it changes the error text of three existing callers. It
consolidates the two copies that had to share it; other inline copies elsewhere in
the codebase are untouched.
assetDegradation.test.tsasserts the degradation path across the publish andimport seam, calling ENG-1870's
publishNodeAssetsalongsideimportNodeAssets.cross-app-asset-referencesOpenSpecchange. The contract between the two halves cannot be asserted from either side
alone.
A doc comment in
mirrorAssetToRoamStoragerecording that nothing rolls an uploadback. Comment only, no behaviour change.
importNodeAssetsdepends on that constraint and it was uncaptured.Local delegated full review
$dg-delegated-full-reviewwhen no other full-review workflow is available.https://linear.app/discourse-graphs/issue/ENG-2247/copy-a-nodes-assets-and-rewrite-its-markdown-for-roam