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
feat: use non-sequential public ids for bounty URLs; fix 404 on DB error
Bounty URLs exposed the sequential integer primary key (/bounties/1),
which is enumerable and leaks the total count. Switch all public bounty
URLs to a non-sequential, URL-safe public_id while keeping the integer
PK internally for joins/FKs.
- lib/id.ts: generatePublicId() (base62 via crypto), mirrored in
migrate.mjs for backfill.
- Migration: add bounties.public_id, backfill existing rows, add a
UNIQUE index.
- POST /api/bounties generates a public_id and returns it; CoinPay
redirect_url + metadata.bounty_id and the funding webhook now key off
public_id.
- Detail page, GET route, claim route, listing links, and auth returnTo
all resolve by public_id.
- Fix the 404 bug: the detail page's getBounty swallowed DB errors and
returned null, so a paused/erroring DB made a real bounty render as
404. Let query errors surface instead of masquerading as not-found.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments