Repository navigation
feat(api)!: delete the employers route, and move user_feedback so /v1/feedback works - #712
Merged
Merged
Conversation
…in no schema
`GET /v1/profiles/employers/{slug}` has never returned a response. It queried
`core.employers`, and information_schema has no `employers` table in any schema
and no `employer_id` column anywhere in `core` — the route was written against
a schema that does not exist, not one that drifted. The handler also counted
jobs by `employer_id`, so there was nothing to repair toward.
`employer` in this product is an organization: `core.organizations` carries
`owner_user_id`, and `core.jobs.organization_id` is the real FK.
`GET /v1/profiles/organizations/{slug}` already does what this route appears to
want, and works (#617).
Deleted: the route, the SDK's `EmployerProfile` / `profiles.getEmployer` /
`useEmployerProfile` (Scaffald/sdk#21, pointer bumped here), the scf-core
wrapper hook and its re-export, and the five Deno tests plus the
`createTestEmployerProfile` helper that inserted into `core.employers`.
`core.employers` is dropped from BASELINE_BROKEN — with the route gone the
entry is stale, and the reference test fails on a stale entry rather than
letting it rot.
BREAKING CHANGE: `GET /v1/profiles/employers/{slug}` is gone, along with
`profiles.getEmployer`, `useEmployerProfile` and `EmployerProfile`. It never
returned a response, so no working behaviour is removed. Use
`GET /v1/profiles/organizations/{slug}` and `useOrganizationProfile`.
Closes #618
Co-Authored-By: Claude Opus 5 <[email protected]>
Contributor
📊 Performance Benchmark Results |
…le at all Every /v1/feedback endpoint failed for any client, for two independent reasons (#665): 1. PostgREST does not serve the `logs` schema. config.toml exposes auth, public, core, storage, data, onet, engagement and community. 2. logs.user_feedback granted only `postgres` — no service_role, no authenticated. Same class as #481 and #654. Migration 350 takes the smaller of the two routes offered in the issue: move the table rather than expose a ninth schema. That keeps the exposed-schema list stable across all three environments, and core is already the convention for user-scoped data. `logs` held nothing else. The table is empty, so nothing is migrated but the definition. SET SCHEMA carries its indexes, constraints, RLS setting and all three policies, which were already correct and role-scoped — select/insert to authenticated on `user_id = auth.uid()`, ALL to service_role. What was missing was never the policies but the grants beneath them: a policy cannot widen access past an absent GRANT, which is why even service_role could not read it. Verified against the running stack. Before, PostgREST answered "Could not find the table in the schema cache". Now it resolves the table and answers 42501 for `anon` — which is the correct outcome, since feedback requires auth and only authenticated and service_role are granted. As `authenticated`, the count runs. The CCPA data summary counts platform feedback again. #663 left it out of the Communications category rather than reporting a silent zero in a statutory disclosure; with the table reachable, the category is "Reviews, platform feedback" and its count includes both. Closes #665 Co-Authored-By: Claude Opus 5 <[email protected]>
thinkclay
force-pushed
the
claude/618-665-dead-routes
branch
from
September 2, 2026 06:44
acc5fb2 to
53abf07
Compare
Contributor
📊 Performance Benchmark Results |
thinkclay
added a commit
that referenced
this pull request
Sep 10, 2026
…rifted (#736) Closes #707. First step on #660, because the schema guard cannot be trusted to measure the rest of that epic while three of its seven baseline entries are about a stale catalogue rather than broken routes. #707 said regenerating from a local database "silently deletes the application_status enum" and treated that as local migration drift, which is why it was left undone. The causality is backwards. Migration 344 DROPPED core.application_status on purpose, five migrations ago, and says why at length: the type was never used, and its vocabulary was not the one the app has. It declared draft / submitted / under_review / interviewing / offer_extended / hired / rejected / withdrawn, while the real vocabulary is the CHECK constraint on core.applications.status — new / screen / inquired / interview / offer / hired / rejected / withdrawn. Three labels overlap. So the local database is CORRECT and types.ts was stale in the other direction, still declaring a type that was deliberately removed. Regenerating is the fix, and the deletion is the point. Verified before overwriting anything: generated to a temp file and diffed. The only removal in 271 diff lines is application_status, with exactly the vestigial vocabulary migration 344 quotes. Nothing consumes the type — the `application_status` hits elsewhere in the tree are a notification category string, unrelated to the Postgres enum, and there is no Enums['application_status'] consumer anywhere. Three baseline entries go with it: core.content_reports and core.user_blocks (mine, #703) and core.user_feedback (#712). All three were real tables with correct routes, listed only because the catalogue had not caught up. before 7 entries, 3 of them not actually broken after 4 entries, all genuinely missing tables What remains in the baseline is now honest, and is the actual remaining surface of #660: core.soft_skills_ratings 8 #658 core.profile_import_data 5 #658 core.inquiries 2 #476 core.profile_completion_nudges 1 #658 Guard: 6/6, including "BASELINE_BROKEN has no stale entries", which is the assertion that would have caught this being left half-done. Typecheck 12/12.
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.
Both of these are routes that have never worked, for the same underlying reason as the rest of #660: the code addresses a schema that isn't there.
#618 — delete
GET /v1/profiles/employers/{slug}No
employerstable in any schema, noemployer_idcolumn anywhere incore. The handler also counted jobs byemployer_id. There was nothing to repair toward — this was written against a schema that does not exist, not one that drifted.employerin this product is an organization:core.organizationscarriesowner_user_id,core.jobs.organization_idis the real FK, andGET /v1/profiles/organizations/{slug}already does the job (repaired in #617).Deleted: the route; the SDK's
EmployerProfile,profiles.getEmployeranduseEmployerProfile(Scaffald/sdk#21, merged, pointer bumped here); thescf-corewrapper hook and its re-export; and the five Deno tests plus thecreateTestEmployerProfilehelper that inserted intocore.employers.Why nothing caught this. The SDK tests mocked
/v1/profiles/employers/:slugin msw and asserted against the mock, so they were green for the entire life of an endpoint that 500s. A mock of an endpoint that cannot exist proves only that the client can parse an object someone made up.core.employersis dropped fromBASELINE_BROKEN— with the route gone the entry is stale, and the reference test fails on stale entries rather than letting them rot.BREAKING CHANGE. The endpoint,
profiles.getEmployer,useEmployerProfileandEmployerProfileare gone. Since it never returned a response, no working behaviour is removed.#665 — move
logs.user_feedbacktocore.user_feedbackEvery feedback endpoint failed for any client, for two independent reasons:
logsschema (config.tomlexposes auth, public, core, storage, data, onet, engagement, community).postgres— noservice_role, noauthenticated. Same class as fix(db): 8 core tables grant SELECT to authenticated but not service_role #481 and core.review_links grants only postgres — both review-link endpoints 500 #654.Migration
350takes the smaller of the two routes the issue offered: move the table rather than expose a ninth schema. That keeps the exposed-schema list stable across all three environments, andcoreis already the convention for user-scoped data.logsheld nothing else.The table is empty, so nothing migrates but the definition.
SET SCHEMAcarries indexes, constraints, the RLS setting and all three policies — which were already correct:What was missing was never the policies but the grants beneath them. A policy cannot widen access past an absent GRANT, which is why even
service_rolecould not read it.Verified against the running stack
core.user_feedbackanon42501 permission denied— correct, feedback requires authauthenticatedCCPA
GET /v1/ccpa/data-summarycounts platform feedback again. #663 deliberately left it out of the Communications category rather than report a silent zero in a statutory disclosure; with the table reachable, the category is now "Reviews, platform feedback" and its count includes both.One consequence worth flagging
core.user_feedbackis new, sotypes.tsdoes not have it, and the reference test flags the corrected route. It is recorded inBASELINE_BROKENwith that explanation rather than hand-edited intotypes.ts— regenerating from the drifted local database deletes an enum (#707). The entry goes stale the moment types are regenerated properly, and the test fails on stale entries, so it cannot rot.Closes #618
Closes #665