[ENG-1852] Keep Roam shared node content fresh#1147
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. |
PR size/scope checkThis PR is over our review-size guideline.
Please split this into smaller PRs unless there is a clear reason the changes need to land together. If keeping it as one PR, please add a brief justification covering:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 554884cf58
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
554884c to
116e32c
Compare
116e32c to
ad939d4
Compare
| import type { LocalContentDataInput } from "@repo/database/inputTypes"; | ||
| import { contentTypes } from "@repo/content-model"; | ||
|
|
||
| export type RoamFullContentNode = { |
There was a problem hiding this comment.
Is the intent to replace this with CrossAppContent eventually?
|
|
||
| const sinceMs = since ?? DEFAULT_SYNC_TIME; | ||
| const query = `[ | ||
| :find ?node-title ?uid ?nodeCreateTime ?nodeEditTime ?pageEditTime ?author_local_id |
There was a problem hiding this comment.
I may be wrong, but I am a bit puzzled that this query uses only node, which seems to bind to the page and not to sub-nodes. I'd expect to find ?page, ?node, a [?node :block/page ?page] clause. Are we sure that nodeEditTime and pageEditTime are ever distinct in the query as written?
There was a problem hiding this comment.
pageEditTime gets updated when any block on the page changes whereas the nodeEditTime is tracking the title of the page. So when we combine both we get the info if this page as a whole entity has changed since last time.
…raph into eng-1852-keep-roam-shared-node-content-fresh-in-the-sync-loop
| direct: { | ||
| localId: node.source_local_id, | ||
| value: title, | ||
| }, |
There was a problem hiding this comment.
@maparent @mdroidian crossAppNode requires direct to be present but crossAppNodeToDbContent converter explicitly requires us to pass the variant type, so should we update the crossAppNode.content an or case?
https://www.loom.com/share/2dcd282d7a0f4a878c8780cbca56c820
Summary
:page/edit-timeor title-level:edit/time.fullmarkdown content without running embeddings, while keeping direct/direct_and_description embedding updates on the existing changed-node path.Manual demo validation:
105833and shared Roam page UIDtzmTaBmqT([[CLM]] - cat -).ResourceAccessandContent.variant = direct, but noContent.variant = full; ran the existing Roam Supabase sync path; confirmed a newfullrow was created with Roam markdowncontent.
fullexisted, edited the Roam page body; ran the existing Roam Supabase sync path again; confirmed the existingfullrow updated with the new page content.