Skip to content

feat: table for collecting interfaces feedback - #48378

Closed
kanadgupta wants to merge 1 commit into
masterfrom
kanad-claude/interfaces-feedback-table-CLI-1946
Closed

kanadgupta wants to merge 1 commit into
masterfrom
kanad-claude/interfaces-feedback-table-CLI-1946

Conversation

@kanadgupta

Copy link
Copy Markdown
Member

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

Adds a migration for creating table (interfaces_feedback) for collecting feedback from interfaces (e.g., CLI, MCP).

What is the current behavior?

N/A

What is the new behavior?

N/A

Additional context

Linear ticket: CLI-1946

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fa6febea-9bf0-4054-96b6-df4e53fda4ea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kanad-claude/interfaces-feedback-table-CLI-1946

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

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Jul 28, 2026 4:48am
docs Ready Ready Preview, Comment, Open in v0 Jul 28, 2026 4:48am
studio-self-hosted Ready Ready Preview, Comment Jul 28, 2026 4:48am
studio-staging Ready Ready Preview, Comment Jul 28, 2026 4:48am
ui-library Ready Ready Preview, Comment Jul 28, 2026 4:48am
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 Jul 28, 2026 4:48am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 28, 2026 4:48am

Request Review

@supabase

supabase Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Updates to Preview Branch (kanad-claude/interfaces-feedback-table-CLI-1946) ↗︎

Deployments Status Updated
Database ✅ Tue, 28 Jul 2026 14:35:12 UTC
Services ✅ Tue, 28 Jul 2026 14:35:12 UTC
APIs ✅ Tue, 28 Jul 2026 14:35:12 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 ⚠️ Tue, 28 Jul 2026 14:35:12 UTC
Migrations ⚠️ Tue, 28 Jul 2026 14:35:12 UTC
Seeding ✅ Tue, 28 Jul 2026 14:35:13 UTC
Edge Functions ✅ Tue, 28 Jul 2026 14:35:14 UTC

⚠️ Warning — You can configure a persistent branch with config.toml:
[remotes.staging]
project_id = "juofuakdhmuwwrndnhwg"

⚠️ Warning — Cannot reset protected branch: try supabase db reset instead


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

@kanadgupta

Copy link
Copy Markdown
Member Author

superseded by #48378, more context here

@kanadgupta kanadgupta closed this Jul 28, 2026
@kanadgupta
kanadgupta deleted the kanad-claude/interfaces-feedback-table-CLI-1946 branch July 28, 2026 23:55
kanadgupta added a commit that referenced this pull request Aug 19, 2026
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Database migration — adds a table for collecting free-form product
feedback submitted from Supabase interfaces (starting with the CLI and
the MCP server), including support for deleting a submission via a
server-issued token.

## What is the current behavior?

There is no destination for feedback submitted from the CLI or MCP
server. The existing `feedback` and `feedback_comments` tables are
scoped to the docs feedback widget, so interface feedback would
otherwise end up as ad-hoc GitHub issues — with no way to revoke
something submitted by accident (e.g. a secret key pasted into the
message).

## What is the new behavior?

Adds `public.interfaces_feedback`:

| Column | Type | Notes |
| --- | --- | --- |
| `id` | `bigint` identity | primary key (not exposed through the API) |
| `created_at` | `timestamptz` | `not null default now()` |
| `feedback` | `text` | `not null`, ≤ 1000 chars — the free-form
feedback |
| `delete_token` | `uuid` | server-generated, `unique not null`;
authorizes deleting the row |
| `user_agent` | `text` | ≤ 255 chars; interface + version, also
identifies the source interface |
| `user_id` | `text` | optional, ≤ 255 chars; unverified,
interface-defined identifier |
| `project_ref` | `text` | optional, ≤ 255 chars |
| `metadata` | `jsonb` | ≤ 8 KB catch-all |

**Submission** happens exclusively through a `SECURITY DEFINER`
function, `submit_interfaces_feedback(...)`, which inserts the row and
returns the server-generated `delete_token` exactly once. There is no
insert grant or policy on the table itself, so clients cannot insert
directly or supply their own token — the function is the only door.
Execute is revoked from `PUBLIC` and granted to `anon` only (both
statements matter: local and hosted databases have different default
function ACLs).

**Deletion** is a hard `DELETE` authorized by presenting the token in an
`x-feedback-token` request header. RLS policies compare the row's
`delete_token` against that header (`current_setting('request.headers',
...)`) — the URL filter is never the security boundary; a request
without the matching header affects zero rows, even with no filter or
someone else's token in the filter. Tokens never expire (the delete
right shouldn't lapse). The header is cast to `uuid` and compared
against the untransformed column, so lookups use the unique index on
`delete_token` even for header-only reads; a malformed token header is
rejected with a `400` (`22P02`), consistent with what a malformed URL
filter value already returns.

**Context gate (defense-in-depth)**: rows submitted with a `project_ref`
and/or `user_id` additionally require the matching
`x-feedback-project-ref` / `x-feedback-user-id` headers — on both reads
and deletes — so a leaked bare token can neither read the submission
text back nor remove the row. A `NULL` column imposes no requirement:
context-free rows keep token-only behavior, and extra headers sent
against them are ignored (this keeps clients that always send their
current context from being locked out of rows submitted without it).
These are client-supplied, unverified values, so the gate is a knowledge
factor rather than an identity check; clients should persist
`{delete_token, project_ref, user_id}` together at submit time and
re-present them byte-exact (`project_ref`/`user_id` are compared as
plain text).

**Reads** are limited to `grant select (feedback, delete_token)` behind
the same token-scoped policy: a token-holder can preview their own
submission text before deleting and confirm the delete matched (`Prefer:
count=exact` → `Content-Range: */1` vs `*/0`). No other columns are
readable by any API role; `delete_token` needs select because PostgREST
requires a WHERE clause on deletes and filter columns require select
privilege.

Verified locally via `supabase db reset` + the local REST API: token
issuance, token-scoped preview and delete, zero-row results for
missing/wrong/malformed tokens (including a victim's token in the filter
without the header), the full context-gate matrix (project+user,
project-only, and context-free rows, incl. lenient extra-header
behavior), denied direct inserts and column reads, length caps enforced
through the function, and no execute for `authenticated`.

## Additional context

Linear tickets: [CLI-1946](https://linear.app/supabase/issue/CLI-1946),
[CLI-1999](https://linear.app/supabase/issue/CLI-1999)

The client-side flows (`supabase feedback add` / `feedback delete` in
the CLI, and the MCP tool) land separately in their respective repos and
will call the RPC / DELETE endpoint described above.

Supersedes #48378 — recreated on a fresh git branch so that the Supabase
preview branch used for testing this table isn't shared with unrelated
work.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added support for collecting and storing feedback submitted through
interfaces.
* Feedback can include submission source, timestamps, user details,
project references, and additional metadata.
* Added secure feedback submission with controlled access to protect
submitted information.
* Added support for authorized feedback removal using a secure deletion
token.
* Added safeguards to validate feedback content and restrict access to
permitted information.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Fable 5 <[email protected]>
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