Repository navigation
Dev - #110
Open
NicolasKieffer wants to merge 5 commits into
Open
Dev#110NicolasKieffer wants to merge 5 commits into
NicolasKieffer wants to merge 5 commits into
Conversation
A user configured with `rateLimit.max: 0` was never blocked: the requests kept returning 200. Two independent causes: - `user.rateLimit.max || 100` evaluated 0 to the default of 100, so the user silently kept a quota of 100 requests per window; - express-rate-limit v5 skips its own check when max is falsy (`if (max && current > max)`), so even a correctly resolved 0 would let every request through instead of answering 429. Resolve the max with Number.isFinite() so 0 is distinguished from "not configured", and answer the 429 from a guard placed before the limiter, since the limiter itself can never do it. The guard mirrors the headers the limiter sets and honours the per-user message. Also stop calling getUserById() unguarded: a valid temporary token whose user was removed from users.json produced a 500 instead of falling back to the default limits. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
While snapshot-reports was unavailable, createReport() failed and the error was deliberately swallowed — a report failure must never fail the request itself. Those requests ended up with no report URL at all. Add a maintenance script to create the missing URLs after the fact, for a single request, for every request of one user, or for all of them. It only ever adds a missing report URL: an existing one is never replaced and the analysis is never re-run. Dry run is the default. This is a recovery patch, not part of the normal flow — whether a given request deserves a report (cached? demo?) stays the operator's call. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
On the EC2 instances the container is managed by systemd, not by the docker run snippets in this file, and the units carry no Restart= directive — a container that loses the boot race against dockerd stays down until someone notices. Document how the service is actually run, the Restart=always drop-in, and why systemctl must be used instead of docker stop. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…rt-urls Fix/rate limit and missing report urls
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.
No description provided.