Files
tiennm99 04925cf789 fix(api): keep the daily pick through upstream blips, mint every session id
A timeout or 5xx from Mapillary no longer moves the day to another
panorama; only a missing image does, and the pick is written with SET NX
so instances that draw differently still serve one. /api/daily maps a dry
pool to 404 and an upstream failure to 502.

/api/new-game always mints a fresh session id instead of reusing the
client's, which let a new round be overwritten mid-guess; /api/guess
rejects ids the server could not have minted. The route reuses the history
it already read, runs round statistics alongside the board writes, and
drops an unreachable error branch. One cookie parser serves the player id
and the debug key; the leaderboard fan-out takes points, not a function,
and no longer rewraps errors.

Tests share one Mapillary stub, the leaderboard stub contract compares a
real scored row, and scanKeys and SET NX are covered.
2026-09-28 15:01:41 +07:00
..