Skip to content

ENG-2359 Speed up my_contents and the other access views to prevent plugin timeouts - #1523

Merged
maparent merged 1 commit into
mainfrom
eng-2359-speed-up-my_contents-and-the-other-access-views-to-prevent
Oct 7, 2026
Merged

maparent merged 1 commit into
mainfrom
eng-2359-speed-up-my_contents-and-the-other-access-views-to-prevent

Conversation

@maparent

@maparent maparent commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

https://entire.io/gh/DiscourseGraphs/discourse-graph/trails/71

Reviewer brief

  • Result: on a local dataset, the space_id <> own space queries on my_contents, my_documents and the embedding view go from 120–150 ms to 3–4 ms, including the direct listing query of getSharedNodeRows. Each query returns the same rows. The measurements are in the ticket comment.
  • Review focus: the embedding view gets no revoke, although Done When lists it. It still joins two tables, so Postgres rejects writes through it with 55000 before it checks privileges, and a revoke changes nothing. This follows the ENG-2368 rule of revoking only on automatically updatable views. The ticket comment records the reason.
  • Review focus: dbTypes.ts gains Insert and Update types for my_contents, my_documents and my_file_references. Type generation reads updatability, not grants, so these types describe writes that the revokes reject. The same happened for my_concepts in ENG-2344.

Verification

  • Cucumber: 34/34 scenarios pass on the test database with the migration applied, including features/contentViewAccess.feature.
  • pnpm ci:validate passes.

Loom video

https://www.loom.com/share/aef158e8a87d451ea73d79f092b035a1

Scope check

  • Ran $scope-check against the ENG ticket and final diff.
  • Scope beyond Done When: None

Standards check

  • Ran $dg-pr-adherence-check against the final diff and PR metadata.

Local delegated full review

  • Ran a comprehensive review of the entire final diff in a subagent with a fresh context. Use $dg-delegated-full-review when no other full-review workflow is available.

https://linear.app/discourse-graphs/issue/ENG-2359/speed-up-my-contents-and-the-other-access-views-to-prevent-plugin


Devin Review

@linear-code

linear-code Bot commented Oct 6, 2026

Copy link
Copy Markdown

ENG-2359

@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
discourse-graph Ready Ready Preview Oct 7, 2026 2:47pm UTC

Request Review

@supabase

supabase Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Updates to Preview Branch (eng-2359-speed-up-my_contents-and-the-other-access-views-to-prevent) ↗︎

Deployments Status Updated
Database ✅ Wed, 07 Oct 2026 14:46:40 UTC
Services ✅ Wed, 07 Oct 2026 14:46:40 UTC
APIs ✅ Wed, 07 Oct 2026 14:46:40 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations ✅ Wed, 07 Oct 2026 14:46:41 UTC
Migrations ✅ Wed, 07 Oct 2026 14:46:41 UTC
Seeding ✅ Wed, 07 Oct 2026 14:46:41 UTC
Edge Functions ✅ Wed, 07 Oct 2026 14:46:44 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@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: 2 flags

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

Devin Review

@maparent
maparent requested a review from mdroidian October 6, 2026 02:35
Base automatically changed from eng-2368-revoke-write-privileges-on-the-my_spaces-and-my_accounts to main October 7, 2026 14:41
@maparent
maparent force-pushed the eng-2359-speed-up-my_contents-and-the-other-access-views-to-prevent branch from b48b8b9 to 00cc537 Compare October 7, 2026 14:45
@maparent
maparent merged commit da9cfd3 into main Oct 7, 2026
18 of 22 checks passed
@maparent
maparent deleted the eng-2359-speed-up-my_contents-and-the-other-access-views-to-prevent branch October 7, 2026 17:05

This branch was successfully deployed

1 active deployment
Preview — 00cc5376 Deployed Oct 7, 2026 by vercel[bot]
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