Repository navigation
ENG-2336 Publish cross-space relations from Obsidian - #1513
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. |
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| } catch (error) { | ||
| // Going on without these groups would delete valid grants. | ||
| console.error("Could not get the groups of imported nodes", error); | ||
| return; |
There was a problem hiding this comment.
🟡 Local relations stop reconciling on remote failure
When an imported-node group lookup fails, ensurePublishedRelationsAccuracy skips local-only relations too. Their missing grants remain missing, and stale grants remain until another successful sync.
Learn more
A full sync reconciles group grants for all locally owned relations. Local endpoints get their groups directly from frontmatter, but imported endpoints require a database lookup. A failure in that lookup currently exits before any local-only relation is reconciled. That also changes the previous behavior, which did not need that lookup for local-only relations.
Example: A local-to-local relation is unpublished from group g1, while an unrelated imported node belongs to another relation. If the imported lookup fails during sync, the local relation's stale g1 grant remains instead of being removed.
Recommended fix: Separate relations with imported endpoints from local-only relations. Reconcile local-only relations from frontmatter even when imported-node lookup fails, while leaving grants for imported-endpoint relations untouched until their groups can be resolved.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Intentional, and documented in the comment on this catch. The lookup only queries when the space has relations with imported ends. On a full sync it runs after upsert_concepts and the synced-relations read, so a database outage fails the sync before this point. That leaves a failure of the lookup alone, which the next full sync recovers from. Splitting reconciliation into local-only and imported-end sets would add a second path through this function to cover that window, so we chose not to.
fef4fe9 to
a6897b9
Compare
a6897b9 to
fb9f2d2
Compare
fb9f2d2 to
bda97ed
Compare
bda97ed to
19ffd27
Compare
https://entire.io/gh/DiscourseGraphs/discourse-graph/trails/59
Reviewer brief
Verification
Unit tests and loom.
Criterion 4 of "Done When" has to come after one of the import PRs ( ENG-2340 or ENG-2339 )
Loom video
https://www.loom.com/share/e56c75cdbb3f436a9365993c7d39f284
Scope check
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.https://linear.app/discourse-graphs/issue/ENG-2336/publish-cross-space-relations-from-obsidian