Repository navigation
Limit each visitor to 10 messages a day - #61
Open
TechNomadCode wants to merge 2 commits into
Open
TechNomadCode wants to merge 2 commits into
TechNomadCode wants to merge 2 commits into
Conversation
Count each visitor's messages to the real model in message_counts, keyed by an HMAC of the IP address (an IPv6 address by its /64) and the UTC day, so no address is stored. Only the secret key reaches the counts, through take_message, which refuses the 11th message without counting it and deletes earlier days' rows. The chat route answers a refused message with a 429, and the page shows when the visitor can carry on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The browser's intro timed its arrivals from the first paint, 15-20ms after the server's page began them, so a swap early in the fade stepped the heading back, which failed the intro's arrival test in CI. It now reads the server's start while it first renders, before React removes the server's intro. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Slice 8: each visitor may send 10 messages to the real model per UTC day; the 11th gets a 429 and a notice saying when they can carry on.
message_counts, keyed by an HMAC of the visitor's IP address (IPv6 by its /64) and the day. No address is stored. Only the secret key reaches them, throughtake_message, which refuses without counting and deletes earlier days' rows.SUPABASE_SECRET_KEYin the Vercel project (README, step 3), or the chat refuses every message.src/serverfiles changed:rate-limit.ts(new, the limit),env.ts(the limit's setting),db/clients.ts(comment),db/database.types.ts(generated).src/lib/chat.tsonly gains the limit's size and refusal text. Nothing the model receives changed.Checks (local): verify (615 unit tests and the build), verify:db, test:e2e (93), verify:secrets.