Skip to content

[Bug]: a site whose fixtures sign in more than ten times fails urlcode test with 429 (Better Auth rate limit in hermetic runs) #1019

Closed

Description

@jimhoyd

Runtime revision and environment

main at 4f80a64 (after #1012) plus the recipes add --project branch for #1014; Node 26, macOS; urlcode test --local-review with the real auth and store extensions in the host.

Minimal reproduction

  1. A site with urlcode init and urlcode extensions add auth store.
  2. urlcode recipes add store-booking --project app, then urlcode recipes add store-credits --project app (no clash; both merge).
  3. urlcode test --project app --host-file host.mjs --local-review

Each recipe passes on its own. Together the fixtures sign in 12 times (5 + 7), and the eleventh POST /api/auth/sign-in/email answers 429 Too many requests, so every later step is skipped and audit is not ready. store-credits + store-approval (14) fails the same way.

Relevant output

{"event":"test","case":64,"pass":false,"method":"POST","path":"/api/auth/sign-in/email","status":429,...}
{"total":68,"failed":5}

The auth extension keeps Better Auth's rate limit on in every run (packages/auth/src/auth.ts: /sign-in/email max 10 per 60 s, database storage, enabled: true), including a hermetic test/audit run on its throwaway database, where every fixture comes from one client address. A site whose own fixtures sign in more than ten times in total cannot pass urlcode test, whatever the order. #1012 worked around it by reordering steps so each recipe signs in at most 7 times.

Possible directions (not decided): a hermetic run's limiter keyed per fixture, a higher bound for hermetic runs only, or a declared per-project allowance. Serving must keep the limit as it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions