Skip to content

perf: avoid dist queries during team read authorization - #1205

Closed
zombieJ wants to merge 2 commits into
3.xfrom
codex/optimize-team-read-query-3x
Closed

zombieJ wants to merge 2 commits into
3.xfrom
codex/optimize-team-read-query-3x

Conversation

@zombieJ

@zombieJ zombieJ commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Backport of #1204 to 3.x.

Summary

  • Look up the package identity and its team binding separately. The package lookup selects only the fields needed for read authorization and avoids loading dist records.
  • Pass the resolved package ID as a parameter to the binding lookup so each table can use its own collation.
  • Keep the existing administrator and team membership checks.

Verification

  • TypeScript type check and scoped ESLint passed.
  • MySQL 9.3 with different package ID collations on the two tables. Checked bound, public, and missing packages. EXPLAIN showed indexed lookups on both tables.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T09:10:17.675517Z cd55a64 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@zombieJ
zombieJ marked this pull request as draft November 10, 2026 09:52
@zombieJ zombieJ changed the title perf: reduce queries for team read authorization perf: avoid dist queries during team read authorization Nov 10, 2026
@zombieJ zombieJ closed this Nov 11, 2026
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.

1 participant