Repository navigation
Release: v0.2.3 - #180
Merged
Merged
Release: v0.2.3#180
Conversation
…points Only /api/** is counted; the SPA shell, assets and thumbnails never are. Credential endpoints get their own per-IP cap; session reads such as GET /api/auth/me are ordinary reads. Per-IP caps are generous because production's load balancer does not yet preserve client addresses, so every visitor currently shares one bucket (cfp-live-cluster #201). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFyA5poHwrhAktrnsKrUiQ
Minutes after cutover the site was returning 429s to everyone. The onRequest hook counted every asset and SPA request against the 60/min read cap (a page load is dozens), GET /api/auth/me sat in the 10/min /api/auth bucket alongside login, and the NodeBalancer hides client addresses so all of that was one shared bucket. Skip non-/api paths, classify credential endpoints explicitly, and put the caps in an exported table the tests assert against. Existing tests that issued 60 requests now prime the bucket instead. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFyA5poHwrhAktrnsKrUiQ
All three plugins use onRequest hooks, which run in registration order, so rate-limit and idempotency saw request.session unset and keyed every signed-in request by IP. The existing test only passed because /me used to fall into a different bucket. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFyA5poHwrhAktrnsKrUiQ
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFyA5poHwrhAktrnsKrUiQ
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFyA5poHwrhAktrnsKrUiQ
fix(api): scope the rate limiter to /api and stop the post-cutover 429 storm
Author
Changelog- fix(api): scope the rate limiter to /api and stop the post-cutover 429 storm [#179] @themightychris |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stops the site-wide 429s seen right after cutover: the rate limiter now counts only
/apirequests, treatsGET /api/auth/meas an ordinary read, and sees the signed-in session before it decides which bucket to use.Improvements