The upstream r-simple-rate tax-rate updates the timestamp on every request,
preventing the window from ever resetting while polling is active. This
caused 429 errors on all API endpoints during normal browser usage.
limiter.lisp:
- Add fixed-window-check that uses proper fixed windows (timestamp only
resets when window expires, not on every request)
- Rewrite define-page-with-limit and define-api-with-limit to call
fixed-window-check directly, bypassing rate:with-limitation entirely
- Immune to Radiance module reload ordering (no monkey-patches)
frontend-partials.lisp:
- Bump now-playing, now-playing-inline, now-playing-json rate limits
from 10/1s to 120/60s to accommodate normal polling intervals
parenscript/front-page.lisp:
- Normalize channel-name polling from 10s to 15s (matches stream-player)
The r-simple-rate library has a bug where rate limit counters can go
negative and never reset. This happens because the reset condition
only triggers when amount >= 0, so negative amounts are permanently
stuck.
This fix adds:
- cleanup-corrupted-rate-limits function to delete corrupted entries
- db:connected trigger to run cleanup automatically on startup
This prevents the 429 error loops that occurred when counters became
corrupted with large negative values.