Skip to content

fix(jobs): Gate Matches tab on JOB_MATCH_ENABLED probe (closes #1095)#1115

Open
jeromehardaway wants to merge 1 commit into
masterfrom
fix/jobs-matches-flag-gate
Open

fix(jobs): Gate Matches tab on JOB_MATCH_ENABLED probe (closes #1095)#1115
jeromehardaway wants to merge 1 commit into
masterfrom
fix/jobs-matches-flag-gate

Conversation

@jeromehardaway

Copy link
Copy Markdown
Contributor

Summary

Implements Option A (preferred) plus a small Option B safety fix.

  • New `useJobMatchAvailability` hook POSTs `/api/j0di3/jobs/match` once on mount. On 503 with code `SERVICE_UNAVAILABLE`, marks the feature unavailable.
  • Jobs page hides the Matches tab from the navigation when unavailable; auto-switches to Job Board if Matches was active when the verdict comes in.
  • `JobMatch.tsx` error reader now handles both shapes — `{error: string}` from the proxy and `{error: {code, message, request_id}}` from the backend — so if the tab ever renders with the flag off, the backend's intentional product copy ("Job matching is not yet available…") is rendered verbatim instead of `[object Object]` or the generic fallback.

Closes #1095. Follow-up from #1080.

Test plan

  • `npm test` — 380/380 pass
  • `npx biome check` on changed files — clean
  • Flag OFF: Matches tab is hidden from Jobs page nav
  • Flag OFF + deep link to `?tab=matches`: tab is unmounted; user lands on Job Board (tabs are local state today, so this is implicit)
  • Flag ON: Matches tab appears and loads normally
  • Backend returns structured 503 `{error: {code: "SERVICE_UNAVAILABLE", message: "…"}}` while Matches tab is open — the message is rendered verbatim

Closes #1095. Follows up #1080.

/jobs/match is 503-gated by JOB_MATCH_ENABLED on the backend, with
the default OFF in production today. Previously every visit to the
Matches tab returned 503 and surfaced a generic "Failed to load
matches" (or "[object Object]") instead of the backend's intentional
product copy.

- New useJobMatchAvailability hook POSTs the endpoint once on mount
  and inspects the response. On 503 with code "SERVICE_UNAVAILABLE",
  it marks the feature unavailable.
- Jobs page hides the Matches tab entirely when unavailable and
  auto-switches to Job Board if Matches was somehow active.
- JobMatch.tsx error reader now handles both error shapes
  ({error: string} from the proxy and {error: {code,message}} from
  the backend), so any intentional product copy is rendered verbatim
  if the tab ever does render with the flag off.
@vercel

vercel Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vets-who-code-app Ready Ready Preview, Comment May 13, 2026 1:10pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

j0di3: Gate Matches tab on JOB_MATCH_ENABLED flag (follow-up from #1080)

1 participant