Skip to content

ENG-2280 Run the asset stage when the sync re-uploads a shared node's content - #1462

Open
maparent wants to merge 1 commit into
mainfrom
eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes
Open

maparent wants to merge 1 commit into
mainfrom
eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes

Conversation

@maparent

@maparent maparent commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Reviewer brief

A lot of changes were a factoring out of now common code into src/utils/__tests__/fixtures/fileReferenceHarness.ts

Verification

Unit tests, plus loom.

Loom video

In progress.

Scope check

  • Ran $scope-check against ENG-2280 and the final diff.
  • Scope beyond Done When: None. The implementation reaches the Done When criteria by a different route than the ticket's Solution proposed: convertRoamNodeToFullContent returns the CrossAppNode it already builds, rather than widening RoamDiscourseNodeData. The node sync path and RoamDiscourseNodeData are unchanged, so the Out of Scope line on converting the sync to CrossAppNode still holds.

Local delegated full review

  • Ran a comprehensive review of the entire final diff in a subagent with a fresh context.

Two problems sit outside this ticket and belong to future ticket(s), not yet filed:

  • Nodes shared before the asset stage existed never ran it.
  • A node whose individual asset copy fails during an otherwise successful sync is never revisited, because re-processing keys on the node's Roam edit time and on a missing Content row, never on FileReference.

Both look the same from the database, an asset referenced in the published markdown with no FileReference row, so one query finds and repairs both. Anything narrower built here would be replaced by that query.

Findings:

  • Failed copies are not retried. Deferred to the ticket above. The PostHog counts are the standing signal until it lands.
  • Bound the asset transfer per run, since SYNC_TIMEOUT is 60s. Also deferred, because a budget without the retry defers exactly the assets nothing comes back for. Overrunning the claim costs a re-claim and a reprocessed window, and each pass keeps the references it already wrote, so passes converge.
  • The sync test mocks roamToCrossAppConverters wholesale. The FK ordering test is added: a failed content upload writes no FileReference row. The mock stays, because unstubbing it needs a fake Roam graph for getFullTreeByParentUid and getPageViewType, and roamToCrossAppConverters.test.ts covers that conversion directly. End-to-end coverage of the sync path is its own ticket.

https://linear.app/discourse-graphs/issue/ENG-2280/run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes-content


Devin Review

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
discourse-graph Skipped Skipped Sep 19, 2026 1:47pm UTC

Request Review

@supabase

supabase Bot commented Sep 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

ENG-2280

@maparent
maparent changed the base branch from main to eng-2219-add-an-asset-copy-stage-to-roam-node-materialization September 17, 2026 17:50
@maparent
maparent added this pull request to stack #1430 September 17, 2026 17:50

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment thread apps/roam/src/utils/syncDgNodesToSupabase.ts Outdated
@maparent
maparent force-pushed the eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes branch from f1f469b to 0ec77a8 Compare September 17, 2026 18:12
@maparent
maparent force-pushed the eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes branch from 0ec77a8 to 4f14371 Compare September 17, 2026 18:46
@maparent
maparent force-pushed the eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes branch from 4f14371 to e084450 Compare September 18, 2026 13:35
@maparent
maparent force-pushed the eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes branch from e084450 to 320b869 Compare September 18, 2026 13:40
@maparent
maparent force-pushed the eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes branch from 320b869 to f06b1cc Compare September 18, 2026 13:43
Base automatically changed from eng-2219-add-an-asset-copy-stage-to-roam-node-materialization to main September 18, 2026 13:45
@maparent
maparent force-pushed the eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes branch from f06b1cc to 1e1f3af Compare September 18, 2026 13:45
@maparent
maparent force-pushed the eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes branch from 1e1f3af to 83c2a8c Compare September 18, 2026 16:21
@maparent
maparent force-pushed the eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes branch from 83c2a8c to 1c35c99 Compare September 18, 2026 16:29
@maparent
maparent force-pushed the eng-2280-run-the-asset-stage-when-the-sync-re-uploads-a-shared-nodes branch from 1c35c99 to da3d84c Compare September 19, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant