fix(rls): payment RLS verified — correct stale audit-log assertion#54
Merged
TortoiseWolfe merged 1 commit intomainfrom Apr 26, 2026
Merged
fix(rls): payment RLS verified — correct stale audit-log assertion#54TortoiseWolfe merged 1 commit intomainfrom
TortoiseWolfe merged 1 commit intomainfrom
Conversation
The 'service role can read all audit logs' test asserted ≥2 rows on the basis of "signup events from user creation," but the monolithic schema has no trigger that writes audit_log rows on auth.users insert. The policy under test is "service role can SELECT all audit logs"; verifying that needs only ≥1 row, which T032 reliably inserts immediately above. Result: tests/rls/* go from 54/55 to 55/55 against both the local docker-compose --profile supabase stack and cloud Supabase. Closes #44. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 27, 2026
TortoiseWolfe
added a commit
that referenced
this pull request
Apr 27, 2026
…andoff (#61) Captures end-of-session state after 6 PRs landed (#54, #55, #56, #58, #59, #60). Family A is empty (both stability hotspots resolved). Family D1 done. Recommended next pickup: B1 (#43 /payment/result page). The handoff doc is the load-bearing artifact for the next operator — it lists open issues by family, sharp edges, and a copy-pasteable quick-start. Co-authored-by: TurtleWolfe <TurtleWolfe@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm test:rlsagainst both local Supabase profile and cloud — 55/55 tests pass on both.tests/rls/service-role.test.tsthat encoded a non-existent contract (auto-instrumented signup audit logs).Closes #44.
What changed
tests/rls/service-role.test.ts— the "service role can read all audit logs" test asserted≥2rows on the basis of "signup events from user creation," but the monolithic schema has no trigger that writes `auth_audit_logs` rows on `auth.users` INSERT. The policy under test is "service role can SELECT all audit logs"; verifying that needs only `≥1` row, which T032 reliably inserts immediately above. Updated the assertion + comment.What didn't change
The 20+ payment RLS policies in
supabase/migrations/20251006_complete_monolithic_setup.sqlare correct as written. They enforce exactly whatfeatures/payments/042-payment-rls-policies/spec.mdclaims.Test plan
docker compose --profile supabase up -d— local supabase stack healthydocker compose exec supabase-db psql -c "SELECT COUNT(*) FROM pg_policies WHERE tablename IN ('payment_intents','payment_results','subscriptions','webhook_events','payment_provider_config');"— returns 17 (matches spec: 5+5+4+2+1)pnpm test:rlsagainst local Supabase: 5 files, 55/55 tests passpnpm test:rlsagainst cloud Supabase: 5 files, 55/55 tests pass (24s vs 4s local — network latency)pnpm test:rlsimmediately a second time also passes (cleanup inafterAllworks)Follow-ups (filed separately, not bundled here)
auth_audit_logssign_up event instrumentation gap (P2). The fix to this test is correct, but the intended feature (auto-write on signup) is real and unimplemented.*@scripthammer.testusers + orphan FKs from a 2026-04-16 run; needed manual scrub before the cloud run could pass. AglobalSetuphook would prevent that.🤖 Generated with Claude Code