Skip to content

Document the Supabase work that needs project access - #167

Open
YurMil wants to merge 4 commits into
mainfrom
docs/supabase-pending-work
Open

Document the Supabase work that needs project access#167
YurMil wants to merge 4 commits into
mainfrom
docs/supabase-pending-work

Conversation

@YurMil

@YurMil YurMil commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Adds dev-plans/supabase-pending-work-2026-08.md — a runbook for the steps that need the Supabase CLI logged in against the production project, so they can be picked up from a machine that has it.

The reason it is worth landing quickly: PR #164 is merged and Vercel has deployed main, so the production bundle already calls report-client-error — a function that has not been deployed. Client error reports are being dropped right now (caught and logged, nothing crashes), and the anon INSERT grant that PR exists to remove is still in place until 20260816000000 is applied. Neither is an emergency; both should be short-lived.

The document covers:

  1. Finishing PR Close the anonymous write path into client_error_log #164 — deploy the function, optionally set ERROR_LOG_IP_SALT, apply the migration, and four SQL checks plus a curl that proves the direct anon write path is actually closed.
  2. The profiles gap — why the preview check is still red after Bootstrap the is_admin() stub before anything references it #166, why it needs a dump from production rather than a reconstruction, where the definition should go, and how to verify it locally with the same Docker harness used for Bootstrap the is_admin() stub before anything references it #166.
  3. Making the check required once it passes.

It ends with a status table for the four open/merged PRs and the dismissed alerts.

🤖 Generated with Claude Code

@supabase

supabase Bot commented Aug 16, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project bkcimygtsnckzexbfqxh because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
cadautoscript-com Ready Ready Preview Aug 17, 2026 6:58pm

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1264b3437

ℹ️ 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".

Comment thread dev-plans/supabase-pending-work-2026-08.md Outdated
Comment thread dev-plans/supabase-pending-work-2026-08.md Outdated
@YurMil

YurMil commented Aug 17, 2026

Copy link
Copy Markdown
Owner Author

Both Codex findings were real and are fixed in the latest commit. Thanks — the second one would have sent someone down a wrong path during the urgent step.

P1 — row check before the function that writes rows exists. Correct, and it went further than the check itself: the document told the operator that deploying the Edge Function restores error reporting. It does not. The function stores nothing on its own — it calls record_client_error(), which 20260816000000 creates — so without the migration the RPC fails, the function swallows it and still answers {"ok":true}, and nothing is written.

Split accordingly: reachability at the deploy step (with an explicit note that no row will land yet, and why), storage verification after the migration. The order still recommends the deploy first, but now for the honest reason — it is cheap and unblocked, while the migration is tangled up in the version mismatch.

P2 — --project-ref on db dump. Verified against the CLI reference: db dump, migration list, migration repair and db push all select their target with --linked / --db-url / --local, and only functions deploy and secrets set accept --project-ref. So the same fault was in migration list too, which the review did not flag. Added a supabase link step up front, moved the db and migration commands to --linked, and spelled out which two commands are the exception so the next reader does not "correct" them back.

One more caught while checking: the first draft of this fix used supabase functions logs, which does not exist — the CLI has list, deploy, download, delete, new, serve. That now points at the dashboard.

Steps renumbered 1a–1e.

YurMil and others added 4 commits August 17, 2026 21:55
Three things are pending that a checkout cannot do on its own, and one of them
is time-sensitive: PR #164 is merged and deployed, so the production bundle
already calls an Edge Function that does not exist yet. Error reports are being
dropped, and the anon INSERT grant the PR exists to remove is still in place
until the migration is applied.

Also records the second half of the preview-check story. PR #166 fixes the
is_admin() ordering; the check then fails on public.profiles, which is
referenced by five migrations and defined by none. Closing that needs the real
table definition dumped from production — reconstructing it from the columns
the migrations happen to touch would turn the check green while describing a
schema that does not exist.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Supabase check reports two different failures depending on where it runs,
and the runbook only covered one of them. On a pull request it builds a database
from the migration files and dies on public.profiles. On main it syncs to
production and dies on "Remote migration versions not found in local migrations
directory" — which it has been doing since at least 7 August, before any of the
recent work.

That second failure matters for task 1: nothing has synced to production for
weeks, so db push is not going to apply the migration cleanly the way the
document originally implied. Added the diagnosis, the migration list step, and
the choice between capturing a remote-only version and discarding the record —
with a warning against reaching for migration repair to silence the error, since
that is how the drift got this far.

Also frames the whole document around that drift: the repository and the
production database disagree in both directions, and every task here is a
symptom of it. Status table refreshed — #165 and #166 are merged, nanoid opened
a new high alert today.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both from the Codex review on this PR, and both were real.

The db commands were written with --project-ref, which they do not accept.
`db dump`, `migration list`, `migration repair` and `db push` select their
target with --linked / --db-url / --local; only `functions deploy` and
`secrets set` take --project-ref. As written, three of the commands would have
exited on an unknown flag. Added a `supabase link` step up front, switched the
db and migration commands to --linked, and said explicitly which two commands
are the exception so the next person does not "fix" them back.

The bigger one: the document told the operator to deploy the function to
restore error reporting, then confirm a row had landed. Neither holds. The
function stores nothing by itself — it calls record_client_error(), which the
migration creates — so deploying it alone restores nothing, and the row check
would have failed and made the urgent recovery step look broken. Split the
verification: reachability at the deploy step, storage after the migration, with
the reason stated in both places. The ordering advice stands, but for the honest
reason — the deploy is cheap and unblocked while the migration is tangled up in
the version mismatch.

While checking flags against the CLI reference I found I had reached for
`supabase functions logs` in the fix itself; there is no such subcommand, so
that now points at the dashboard and says so. Steps renumbered 1a–1e.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
No dependabot alerts remain open. What is left in the runbook is now exactly
the work that needs Supabase project access, which is worth saying explicitly
so the next reader does not re-audit the closed items.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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