Skip to content

build(deps): move to ledger 1.9.3 and authsome 1.12.2; fix rate-limit test flake - #15

Merged
juicycleff merged 3 commits into
mainfrom
build/ledger-1.9.3
Nov 16, 2026
Merged

juicycleff merged 3 commits into
mainfrom
build/ledger-1.9.3

Conversation

@juicycleff

@juicycleff juicycleff commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

On app.loomplane.com, POST /api/v1/billing/setup-session answers 500 and the card form never opens. Stripe now enables Managed Payments by default, and Managed Payments only accepts subscription and payment mode. Ledger opens the card form as a setup-mode Checkout session, so Stripe refused it:

stripe: create setup session for tenant aorg_…: Invalid mode: setup. Managed Payments, which is enabled by default on your account, only supports mode: subscription or mode: payment.

Dependencies

Rate-limit test flake

TestSignupGate_floodIsRateLimited failed on CI with a fourth sign-up from one address: 403, want 429. This has been flaky since the test was written; neither bump caused it. The limiter Loomplane gives authsome (ratelimit.NewKVLimiter) counts in fixed one-minute windows aligned to the clock. Under -race, the run of sign-ups can cross a minute boundary. The count then starts again from zero, and the fourth sign-up reaches the waitlist (403) instead of the limit (429).

A new helper, inOneRateWindow, waits for the next minute when less than half of the current one is left. It's called before every run of requests that has to share a window:

  • the sign-up flood and the office sign-ups in TestSignupGate_floodIsRateLimited;
  • the six setup attempts in TestSetup_validation;
  • the joins in TestNodes_listCancelAndLimitJoinTokens.

Those three tests occasionally take up to about 30 seconds longer.

Testing

  • go build ./... and go build -tags cloud ./... both pass.
  • go test ./... passes.
  • go test -tags cloud passes for internal/billing, extensions/billing and extensions/identity.
  • With -race, all of TestSignupGate_* and TestSetup_* pass, as do TestNodes_listCancelAndLimitJoinTokens and TestAccount_twoStepAndPasskeys.
  • Not run: a real card setup against Stripe test mode, and the full integration suite (CI covers that).

Saving a card answered 500 on app.loomplane.com: Stripe enables Managed Payments by default and refused ledger's setup-mode Checkout session with "Invalid mode: setup". ledger 1.9.3 turns Managed Payments off for that session alone (xraph/ledger#47).
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loomplane-docs Ready Ready Preview Nov 15, 2026 3:11am UTC

Request Review

authsome 1.12.2 moves to ledger 1.9.3 and forge 1.13.7, which this branch already requires. No migrations.
TestSignupGate_floodIsRateLimited failed on CI with "a fourth sign-up from
one address: 403, want 429". The limiter Loomplane gives authsome counts in
fixed one-minute windows aligned to the clock. Under -race the run of
sign-ups can cross a minute boundary, the count starts again from zero, and
the fourth sign-up reaches the waitlist instead of the limit.

inOneRateWindow waits for the next minute when less than half of the
current one is left. The sign-up flood, the office sign-ups, the setup
validation run and the node-join run all call it before the requests that
have to share a window.
@juicycleff juicycleff changed the title build(deps): move to ledger 1.9.3 build(deps): move to ledger 1.9.3 and authsome 1.12.2; fix rate-limit test flake Nov 15, 2026
@juicycleff
juicycleff merged commit b8c2e49 into main Nov 16, 2026
30 checks passed
@juicycleff
juicycleff deleted the build/ledger-1.9.3 branch November 16, 2026 04:49
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.

1 participant