Skip to content

fix: restrict app suggestions to public boards#39

Open
BunsDev wants to merge 1 commit into
mainfrom
codex/propose-fix-for-sidebar-app-key-issue
Open

fix: restrict app suggestions to public boards#39
BunsDev wants to merge 1 commit into
mainfrom
codex/propose-fix-for-sidebar-app-key-issue

Conversation

@BunsDev
Copy link
Copy Markdown
Member

@BunsDev BunsDev commented Jun 5, 2026

Motivation

  • Prevent leakage of private-board posts from the embedding-backed /api/v1/apps/suggest endpoint which is callable by browser-scoped app keys by ensuring the vector search only returns posts from public, non-deleted boards.

Description

  • Restrict the embedding vector search in apps/web/src/routes/api/v1/apps/suggest.ts by adding eq(boards.isPublic, true) and isNull(boards.deletedAt) to the query WHERE clause and updating the comment, while preserving the existing deletion/embedding/similarity filters, ordering, limit, text-search fallback, and API-key auth.

Testing

  • Ran git diff --check which reported no issues; attempted bun run typecheck but it could not complete due to missing type definitions/dependencies; bun install failed with registry 403 responses so a full typecheck and test run were not possible.

Codex Task

Copilot AI review requested due to automatic review settings June 5, 2026 23:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the /api/v1/apps/suggest vector-similarity search to prevent returning posts from private or soft-deleted boards when the endpoint is called with browser-scoped app keys.

Changes:

  • Restricts the vector search query to boards.isPublic = true.
  • Excludes soft-deleted boards from vector search via boards.deletedAt IS NULL.
  • Updates the in-code comment to reflect the new vector search scope.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BunsDev BunsDev self-assigned this Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants