Skip to content

ENG-1711 Reciprocal stored relations not updating after being added#1146

Open
trangdoan982 wants to merge 2 commits into
mainfrom
eng-1711-reciprocal-stored-relations-not-updating-after-being-added
Open

ENG-1711 Reciprocal stored relations not updating after being added#1146
trangdoan982 wants to merge 2 commits into
mainfrom
eng-1711-reciprocal-stored-relations-not-updating-after-being-added

Conversation

@trangdoan982

@trangdoan982 trangdoan982 commented Jun 22, 2026

Copy link
Copy Markdown
Member

Bug analysis:
https://www.loom.com/share/90f39d46cf4b49cf94c47ebb98645ba3

Bug fix test:
https://www.loom.com/share/1dbd7a00ab224f79903ee7e2af945e1a

Summary

  • Guard matchDiscourseNode against missing or malformed specification values to avoid discourse context query crashes.
  • Add mutation-targeted discourse context refresh for stored relation create/delete by dispatching affected source/destination UIDs.
  • Refresh only mounted contexts whose UID is affected, using ignoreCache: true for mutation-triggered refreshes while keeping passive/default loads cached.
  • Ensure create dialog close/cancel paths do not trigger mutation refresh behavior.

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

  • Create a stored relation from an open discourse context and verify both affected source/destination contexts refresh if currently open.
  • Delete a stored relation from results table and verify affected open contexts refresh immediately.
  • Open discourse context passively (no mutation) and verify normal cached behavior remains unchanged.
  • Cancel/close the create relation dialog and verify no forced refresh occurs.
  • Verify no regression for has title specification matching and nodes with missing specifications.

Made with Cursor


Open in Devin Review

@linear-code

linear-code Bot commented Jun 22, 2026

Copy link
Copy Markdown

ENG-1711

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
discourse-graph Skipped Skipped Jun 22, 2026 11:36pm

Request Review

@supabase

supabase Bot commented Jun 22, 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 ↗︎.

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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>
@mdroidian

Copy link
Copy Markdown
Member

@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"?

@trangdoan982 trangdoan982 changed the title ENG-1711 Guard matchDiscourseNode when specification is missing ENG-1711 Reciprocal stored relations not updating after being added Jun 23, 2026
@trangdoan982

Copy link
Copy Markdown
Member Author

@mdroidian yes I updated. My bad it was the title from the first commit that I forgot to update

@mdroidian

mdroidian commented Jun 23, 2026

Copy link
Copy Markdown
Member

@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.

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.

2 participants