Skip to content

fix(api): core.inquiries does not exist, so GET/POST /v1/inquiries always 500 #476

Closed

Description

@thinkclay

Found while fixing #443.

GET /v1/inquiries and POST /v1/inquiries — the only two inquiry endpoints that existed before #443 — both query core.inquiries:

supabase.schema("core").from("inquiries").select("*", { count: "exact" })

That table does not exist.

$ psql -c "select coalesce(to_regclass('core.inquiries')::text,'MISSING');"
MISSING

So both endpoints 500 on every call. Verified against a freshly reset local database (all 177 migrations applied).

There are two different "inquiry" concepts here

Table Status
Sender/recipient messaging — sender_id, recipient_id, subject, message, inquiry_type core.inquiries never created
ATS capability inquiry — negotiable terms on an application core.application_inquiries (+ inquiry_sections, inquiry_comments, inquiry_capability_responses, inquiry_templates, inquiry_audit_log, inquiry_reminders) exists

The SDK's Inquiry type, list, create, respond, templates, bulkMarkAsRead and bulkArchive all model the first concept. #443 and the app's inquiry pages need the second. The shared name is doing real damage — it is why the two got conflated in the first place.

Decide which one is real

Either:

  • the messaging concept is wanted → add a migration creating core.inquiries with the columns the endpoints and SDK type already assume; or
  • it is not → delete those endpoints and the SDK methods, and rename the remaining surface to something unambiguous (applicationInquiries), so inquiries stops meaning two things.

Worth resolving before porting the remaining 15 methods tracked in #443, since the answer changes what those methods should even be called.

Activity

  1. added
    bug
    needs-design
    on Jul 30, 2026
  2. thinkclay commented on Jul 30, 2026

    @thinkclay
    ContributorAuthor

    #447 tracks the general form of this — an audit found 85 SDK methods calling endpoints that don't exist. This issue is the sharpest instance, and the one that blocks #443, since the fix here decides whether the remaining 15 inquiry methods belong on client.inquiries or a new client.applicationInquiries.

    Same shape as #482 (profiles routes selecting nonexistent columns / core.employers), so a fix pattern for one likely applies to the other.

  3. thinkclay commented on Aug 27, 2026

    @thinkclay
    ContributorAuthor

    Confirmed still broken, and now part of a larger pattern: a sweep of every .from() in every route file found 45 references to tables that do not exist, across 24 names and 14 files (#660). core.inquiries is 2 of them.

    #651 adds a guard so new instances fail a test rather than a page: it parses every .from() against the checked-in generated types, with the current 45 recorded as a baseline that can only shrink. core.inquiries is in that baseline — closing this issue means removing its entry, and the test fails if it is fixed but left listed.

  4. thinkclay commented on Sep 10, 2026

    @thinkclay
    ContributorAuthor

    Still live, re-verified today against the running API:

    GET /v1/inquiries
      500  {"error":"Failed to fetch inquiries",
            "message":"Could not find the table 'core.inquiries' in the schema cache"}
    

    select to_regclass('core.inquiries') → MISSING. core.inquiry_comments does exist, which is the confusing part: the thread's messages have a home, the thread itself does not.

    This now carries a store-readiness consequence

    Two of them, neither obvious when this was filed:

    1. A reviewer clicking into an inquiry gets a 500. Both stores exercise the app; a core screen erroring is a rejection risk, not just a bug.
    2. It makes part of No way to report content, report a user, or block anyone — both stores require all three for UGC #690 unreachable. The stores require reporting on user-generated content, and inquiry threads are where an employer and a candidate actually talk. The per-message report control shipped in feat(moderation): report content, report people, block people #703 and is correct — but it renders on a screen that cannot load.

    So this is on the iOS/Android readiness path now, not just the API-correctness backlog. Raising priority accordingly.

  5. added
    agent-ready
    on Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugneeds-designpriority: hightype: backend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions