You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
types.ts is stale: #703's moderation tables are missing, and regenerating locally deletes application_status #707
core.content_reports and core.user_blocks exist in the database. They are absent from packages/supabase/types.ts, because #703 shipped their migrations without regenerating it.
That makes table-references-exist.test.ts fail on unmodified main:
core.content_reports: 2 reference(s), baseline 0 — at moderation.ts:221, moderation.ts:287
core.user_blocks: 4 reference(s), baseline 0 — at moderation.ts:350, moderation.ts:361, moderation.ts:403, moderation.ts:451
The routes are correct. The catalogue the test reads is stale.
2. pnpm supa:generate against a local database makes it worse
The obvious fix is to regenerate. Don't — not from a local stack without checking the diff first. Doing it here produces a 199-line diff that adds the three expected objects (content_reports, user_blocks, and the users_are_blocked view) and also deletes the application_status enum:
selectcount(*) from pg_type t join pg_namespace n onn.oid=t.typnamespacewheret.typname='application_status';
-- 0
The local database does not have that enum; the checked-in types.ts declares it. So the generator faithfully reports what it sees, and the result silently drops a type. That is local migration drift, and it means supa:generate is only safe from a database known to be current.
Interim state
Both references are listed in BASELINE_BROKEN with a comment explaining they are a types-staleness problem rather than broken references (landed alongside the #656/#657/#659 fixes). The list's invariant still holds: once types.ts is regenerated correctly, those entries go stale and the test will demand their removal.
Acceptance
types.ts contains core.content_reports, core.user_blocks and users_are_blocked
It still contains application_status with all eight values
The two entries are removed from BASELINE_BROKEN and the test passes
The local-drift cause is either fixed or recorded — supa:generate from a drifted database should not be able to delete a type silently
Worth considering
supa:generate writes straight over types.ts with no diff review. A guard that refuses a regeneration which removes a table, view or enum would have caught this before it reached anyone.
Also affected, from the other direction: migration 350 in #708 creates core.user_feedback (moving it out of the unexposed logs schema, #665). That table is likewise absent from types.ts, so table-references-exist.test.ts flags the corrected route as broken.
It is recorded in BASELINE_BROKEN with the same explanation rather than hand-edited into types.ts, for the reason above — regenerating from the drifted local database deletes application_status.
So the regeneration this issue asks for should clear three entries, not two:
Activity
test(api): record #703's moderation refs as types-staleness, not brok…
test(api): record #703's moderation refs as types-staleness, not brok…
test(api): record #703's moderation refs as types-staleness, not brok…
thinkclay commentedon Sep 2, 2026
Also affected, from the other direction: migration 350 in #708 creates
core.user_feedback(moving it out of the unexposedlogsschema, #665). That table is likewise absent fromtypes.ts, sotable-references-exist.test.tsflags the corrected route as broken.It is recorded in
BASELINE_BROKENwith the same explanation rather than hand-edited intotypes.ts, for the reason above — regenerating from the drifted local database deletesapplication_status.So the regeneration this issue asks for should clear three entries, not two:
core.content_reports(feat(moderation): report content, report people, block people #703)core.user_blocks(feat(moderation): report content, report people, block people #703)core.user_feedback(migration 350)Each will go stale the moment types are correct, and the test fails on stale entries — so nothing here can rot quietly.
fix(api): five routers addressed tables that do not exist, and one te…
ci(types): guard types.ts generation, and finish migration 350's move (…