ENG-1711 Reciprocal stored relations not updating after being added#1146
ENG-1711 Reciprocal stored relations not updating after being added#1146trangdoan982 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. |
Trigger targeted discourse-context refreshes for affected source/destination UIDs after create/delete so mounted views update immediately, while preserving cached behavior for passive loads. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@trangdoan982 The ticket's title is "reciprocal stored relations not updating after being added" and the videos seem to reflect that as well, but the PR title and body says "Guard matchDiscourseNode when specification is missing". Could you clarify how "guard matchDiscourseNode when specification is missing" is related to "reciprocal stored relations not updating after being added"? |
|
@mdroidian yes I updated. My bad it was the title from the first commit that I forgot to update |
@trangdoan982 I see the related commit is still there. If it is no longer relevant to the ticket/PR, please remove it (and add it to a separate ticket if it is fixing a separate problem). If it is relevant, please explain how it is relevant and what tests have been done to ensure this change is not causing any regression. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29eebfce43
ℹ️ 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".
| }); | ||
| } | ||
| onClose(); | ||
| onClose(created); |
There was a problem hiding this comment.
Preserve the create result when closing the overlay
When the dialog is opened via renderOverlay, the onClose prop passed into this component is a zero-argument wrapper that calls the original props.onClose() without forwarding arguments. As a result, this created value is dropped before it reaches the CreateRelationButton callers, so their new if (!created) return guards always skip the 150ms refresh after a successful create; in cases where the immediate mutation event runs before Roam's write is visible, the source context can remain stale.
Useful? React with 👍 / 👎.
Bug analysis:
https://www.loom.com/share/90f39d46cf4b49cf94c47ebb98645ba3
Bug fix test:
https://www.loom.com/share/1dbd7a00ab224f79903ee7e2af945e1a
Summary
matchDiscourseNodeagainst missing or malformedspecificationvalues to avoid discourse context query crashes.ignoreCache: truefor mutation-triggered refreshes while keeping passive/default loads cached.Why
Reciprocal stored relations could appear stale in open discourse context UI (especially across sidebar/main workflows) because mutation outcomes were not consistently propagating to mounted context views. This keeps default cached behavior intact and applies cache bypass only where mutation freshness is required.
Test plan
has titlespecification matching and nodes with missing specifications.Made with Cursor