fix(types): regenerate Supabase types + fix masked payment-retry schema drift#135
Merged
Conversation
…nt-retry schema drift
Regenerated src/lib/supabase/types.ts from the live schema via the Supabase
Management API (GET /v1/projects/{ref}/types/typescript — no local CLI install).
The old generated types were stale and were MASKING real bugs:
1. auth_audit_logs.Row was missing success/error_message → removed the
boundary-cast workaround added in #131 (UserAuditTrail.tsx).
2. The fresh types exposed that payment_intents.retry_count + parent_intent_id
DON'T EXIST in the live DB — yet payment-service.ts (FR-009 retry limit) and
usePaymentRetryStatus.ts read/write them. retryPayment() would fail at
runtime; only the mocked unit tests passed. The columns ARE in the monolithic
migration (lines 69-76, #43/B1) — they were just never applied to prod
(same prod-vs-migration drift class as #49). Applied the idempotent
ADD COLUMN IF NOT EXISTS to prod via the Management API + verified; the
payment-retry feature now actually works.
3. My #26 recordSystemMessage insert was missing the required messages.
sequence_number — the fresh (stricter) types caught it; added the placeholder
:0 (the assign_sequence_number() trigger overwrites it, matching
message-service.ts:335/516).
Also picks up edge_idempotency_keys (the #130 table) now that it's in the types.
Gates: type-check clean (was failing on retry_count before the prod fix), lint
clean, 41 affected tests pass (UserAuditTrail / payment retry / group membership).
Co-Authored-By: Claude Opus 4.8 (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.
Regenerates
src/lib/supabase/types.tsfrom the live schema (Supabase Management API — no local CLI install). The stale types were masking real bugs:What the regen surfaced + fixed
auth_audit_logs.success/error_message— were missing from the old types. Removed the boundary-cast workaround added in feat(security): #23 user-facing security-activity dashboard #131 (UserAuditTrail.tsx).payment_intents.retry_count+parent_intent_iddon't exist in the live DB — yetpayment-service.ts(FR-009 retry limit) andusePaymentRetryStatus.tsread/write them.retryPayment()would have failed at runtime; only the mocked unit tests passed. The columns are in the monolithic migration (lines 69–76, [Gap-Audit] 040 Payment Retry UI: idempotency-key reuse, retry counter + cooling, error categorization, offline banner, audit log #43/B1) — they were just never applied to prod (same drift class as [Gap-Audit] auth_audit_logs sign_up events not written for all signup paths #49). Applied the idempotentADD COLUMN IF NOT EXISTSto prod via the Management API + verified. The feature now actually works.messages.sequence_number— the stricter fresh types caught that my [Gap-Audit] 011 + 043 Group Chats / Group Service: implement 8 stub member-management methods #26recordSystemMessageinsert omitted this required column; added the:0placeholder (theassign_sequence_number()trigger overwrites it, matchingmessage-service.ts).Also picks up
edge_idempotency_keys(the #130 table) in the types.Verification
retry_countuntil the prod columns were added)Part of the #115 Tier-2 sweep (quick-win). 🤖 Generated with Claude Code