Skip to content

Name the shared bucket for requests without a client IP - #984

Merged
richshaw merged 2 commits into
mainfrom
claude/fervent-heisenberg-b89oby
Nov 15, 2026
Merged

richshaw merged 2 commits into
mainfrom
claude/fervent-heisenberg-b89oby

Conversation

@richshaw

@richshaw richshaw commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Eight per-IP rate limits each wrote ip ?? 'unknown': sign-up, the edit-token routes, unsubscribe, landing telemetry, MCP, OAuth, magic link and the sign-in code. Two of them carried a comment explaining why a request without a readable IP is charged to a shared bucket instead of skipping the limit.

ipSubject(ip) in src/lib/rate-limit.ts states that rule once, with the explanation, and every per-IP charge goes through it. The subject string is unchanged ('unknown'), so rate-limit windows already open carry on as before.

Testing

  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test: all pass (2364 tests).
  • New unit test: a known IP is charged to itself, and the shared bucket can never be mistaken for a real IP.

🤖 Generated with Claude Code

https://claude.ai/code/session_016YZ9SRpoJR3rjZvGEi3nAY

Seven per-IP rate limits each wrote `ip ?? 'unknown'`, and two of them
explained in a comment why a missing IP shares a bucket rather than
skipping the limit. `ipSubject` in rate-limit.ts says it once, so a new
per-IP limit picks up the rule instead of re-deriving it. Subjects are
unchanged, so existing windows carry on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SRpoJR3rjZvGEi3nAY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SRpoJR3rjZvGEi3nAY
@richshaw
richshaw merged commit b40d016 into main Nov 15, 2026
5 checks passed
@richshaw
richshaw deleted the claude/fervent-heisenberg-b89oby branch November 15, 2026 17:16
richshaw pushed a commit that referenced this pull request Nov 15, 2026
budgets.json conflicted with main's Next.js update (#983), which raised
/s/[slug]/c/[id] from 110 to 111. This PR had already raised that line and
the two beside it, so the PR's numbers are kept; main's other lines are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 15, 2026
…o the dialog text PR

Brings main's three new commits up through #912's new head.

Conflicts:
- capacity-message.ts: #806 moved the "Pick another slot." decision into
  offersAlternatives(), which the dialog's "See alternatives" link also
  calls. This PR had moved the same lines to the catalog. The resolution
  keeps both: offersAlternatives(error) decides, and the words come from
  participant.errors as before.
- capacity-message.test.ts: both import lines kept (the test translators and
  offersAlternatives); #806's offersAlternatives tests merged as they are.
- budgets.json: this PR's four numbers kept, then re-measured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 15, 2026
…e Swedish seed PR

Brings main's three new commits up through #913's new head. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 16, 2026
…he edit page locale PR

Brings main's three new commits up through #914's new head. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 16, 2026
…to the edit page text PR

Brings main's three new commits up through #915's new head.

Conflict: budgets.json, /s/[slug]/c/[id]. #913 raised it from 113.6 to
113.7 kB for main's Next.js update; this PR had lowered it from 113.6 to
113.5. Re-measured on this merge: the page loads 113,450 B (gzip), which is
113.5 kB rounded up, so this PR's 113.5 stands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 16, 2026
… the error reasons PR

Brings main's three new commits up through #916's new head. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 16, 2026
…the client error text PR

Brings main's three new commits up through #917's new head.

Conflict: commit-dialog.tsx. #806 made the "See alternatives" link ask
offersAlternatives(error), the same rule as the "Pick another slot." copy,
in place of an inline check that skipped the error code and compared
remaining === 0. This PR had moved that inline check into the sign-up's
failure branch, as the DialogError's seeAlternatives flag. The resolution
keeps this PR's DialogError and render, and sets the flag with
offersAlternatives(failure). Both imports are kept, and ApiError keeps this
PR's details.reason with #806's SlotAlternative[] for alternatives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 16, 2026
…nto the email subjects PR

Brings main's three new commits up through #918's new head. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 16, 2026
… the email templates PR

Brings main's three new commits up through #919's new head. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 16, 2026
…o the calendar share text PR

Brings main's three new commits up through #920's new head. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 16, 2026
… into the calendar file name PR

Brings main's three new commits up through #921's new head. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 16, 2026
…into the default columns PR

Brings main's three new commits up through #925's new head. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw pushed a commit that referenced this pull request Nov 16, 2026
main moved on by 62 commits since this branch was built: the whole
localization stack (#897 to #999) plus #806, #890, #983 and #984.

Files main added in folders this branch moved now sit in the route groups:
eleven under src/app/(organizer)/app/(chrome)/, six under
src/app/(organizer)/login/ and one under src/app/(organizer)/oauth/.
main's footer `locale` on src/app/s/layout.tsx moves into
src/app/s/[slug]/layout.tsx, which absorbed it, and the global 404 passes
one too. CHANGELOG.md keeps both sides' entries, CLAUDE.md the new consent
paths and main's Languages line, and a11y.spec.ts both new tests.

The lint rule lists in eslint.config.mjs, the file list in
no-hard-coded-text.test.ts, two test imports and two comments now name the
new paths. The signup page's metadata test expects the tab title the page
writes itself (`title.absolute`), as it does on this branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants