Repository navigation
docs: unique constraints are an existence oracle on access-scoped lists - #1774
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVTKtZrZbRq9APE49o2y46
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Review of PR #1774 (docs-only, unique-constraint existence oracle, issue #1654)The review found 3 documentation issues, none blocking. The review did not report separate findings for the cross-doc consistency, snippet validity or link checks, so I am not claiming a full manual pass on those. 1. Tenant-scoped unique index example does not pin the tenant
The Suggested fix: say that the tenant must be pinned by the access filter or a 2.
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVTKtZrZbRq9APE49o2y46
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5cb99c19b
ℹ️ 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".
|
|
||
| A session that updates its own `email` to another user's address receives the violation, confirming that address is taken even though it cannot read that user. The same applies to `create` for any caller with create access. A restrictive foreign key (`onDelete: 'restrict'`) likewise reveals, by blocking a delete, that rows the session cannot read still reference the target. | ||
|
|
||
| No runtime check can close this: the database alone knows about the colliding row, and any outcome other than success differs from success. The stack keeps the field-mapped message on purpose (see ADR-0042). Mitigate in the schema and at the edge: |
There was a problem hiding this comment.
Document indistinguishable success responses as a mitigation
The claim that no runtime behavior can close this channel is too absolute. For flows where the caller does not need the created row—such as registration, invitations, or password-recovery requests—the endpoint can catch a uniqueness violation and return exactly the same status and payload as a successful write, preventing the caller from distinguishing an existing address from a new one. This is especially important when uniqueness must remain global and cannot be scoped to a tenant; qualify the claim for writes whose success is independently observable and document uniform success responses as an additional edge mitigation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. The claim is now qualified to writes whose success the caller observes, and uniform success responses are documented as a mitigation.
Generated by Claude Code
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVTKtZrZbRq9APE49o2y46
Coverage Report for Core Package Coverage (./packages/core)
File CoverageNo changed files found. |
Coverage Report for UI Package Coverage (./packages/ui)
File CoverageNo changed files found. |
Coverage Report for CLI Package Coverage (./packages/cli)
File CoverageNo changed files found. |
Coverage Report for Auth Package Coverage (./packages/auth)
File CoverageNo changed files found. |
Coverage Report for Storage Package Coverage (./packages/storage)
File CoverageNo changed files found. |
Coverage Report for RAG Package Coverage (./packages/rag)
File CoverageNo changed files found. |
Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)
File CoverageNo changed files found. |
Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)
File CoverageNo changed files found. |
Summary
db.indexestenant-scoped snippet, rate-limit andonDeleteguidanceNo source or behaviour change, so no changeset.
Test plan
db.indexes/isIndexed: 'unique'APICloses #1654
🤖 Generated with Claude Code
https://claude.ai/code/session_01NVTKtZrZbRq9APE49o2y46
Generated by Claude Code