Repository navigation
build(deps): move to ledger 1.9.3 and authsome 1.12.2; fix rate-limit test flake - #15
Merged
Merged
Conversation
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).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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.
On app.loomplane.com,
POST /api/v1/billing/setup-sessionanswers 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:Dependencies
Rate-limit test flake
TestSignupGate_floodIsRateLimitedfailed on CI witha 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:TestSignupGate_floodIsRateLimited;TestSetup_validation;TestNodes_listCancelAndLimitJoinTokens.Those three tests occasionally take up to about 30 seconds longer.
Testing
go build ./...andgo build -tags cloud ./...both pass.go test ./...passes.go test -tags cloudpasses forinternal/billing,extensions/billingandextensions/identity.-race, all ofTestSignupGate_*andTestSetup_*pass, as doTestNodes_listCancelAndLimitJoinTokensandTestAccount_twoStepAndPasskeys.