Repository navigation
fix: requests never wait on an unavailable WebDecoy, and buffers stay bounded - #60
Merged
Merged
Conversation
… bounded - The client pauses all calls after a 429, a 5xx or no answer (Retry-After, else 1s doubling to 60s). While paused, calls throw WebDecoyUnavailableError without touching the network, so protect() fails open at once instead of waiting out the timeout on every request. - The failure that starts a pause logs as an error; paused requests log at debug, so an outage does not flood the operator's logs. - Violations are held while paused (capped at 1,000, oldest dropped) and sent when WebDecoy returns; the IP enrichment cache is capped at 10,000; AI referral counting stops adding pairs (and stops triggering sends) while an unsent batch waits. - A 429 on AI referrals keeps the batch for retry under the same id. Each protection is mutation-checked by src/outage.test.ts.
Merged
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.
Problem: while WebDecoy was slow or unavailable:
protect()waited the full timeout (default 5s) on every suspicious request before failing open.Fix
Retry-Afterwhen given, otherwise 1s doubling to 60s.WebDecoyUnavailableErrorwithout a request, soprotect()returnsERRORat once (fail open, as before).Tests: 506 pass (9 new in
src/outage.test.ts), plus tsc and eslint.