Follow Stripe's listing cursor when fetching webhook endpoints - #2024
Conversation
fetchWebhookEndpoints read only the first page of webhook endpoints, so same-URL strays beyond 100 endpoints were never seen by cleanup. The list schema now requires Stripe's has_more marker, the client accepts a starting_after cursor, and the fetch walks every page — failing loudly if Stripe reports more pages but sends an empty one. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKyfP7ai7DR9ChC2CjcHjA
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKyfP7ai7DR9ChC2CjcHjA
A third .at(-1) call site pushed the built-in over the rule's threshold. Like padStart and toFixed, at() is a platform method whose constant argument is the idiom itself, and no application function shares the name. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKyfP7ai7DR9ChC2CjcHjA
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
Comment |
The mutation gate only runs a source's mirror-located direct tests plus integration tests changed on the branch, so the endpoint-limit recovery tests in test/integration/stripe/webhook-setup.test.ts never guarded src/shared/stripe/endpoints.ts during mutation runs. They are fetch-mock unit tests of that module, so they now live at its mirror path. Also close the three remaining assertion gaps: - cleanup asserts the Stripe client is created with zero network retries - connection health asserts the listing error is reported word for word - the webhook endpoint schema test accepts both endpoint statuses Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKyfP7ai7DR9ChC2CjcHjA
Assert over the mapped calls list instead of calls[0], which is possibly undefined under the checker and also pins the call count. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKyfP7ai7DR9ChC2CjcHjA
|
@coderabbitai review |
✅ Action performedReview finished.
|
Closes the "Same-URL stray listing doesn't paginate" follow-up recorded in TODO.md (from the PR #1827 review).
What changed
When the site cleans up old Stripe webhook endpoints, or checks the connection health page, it asked Stripe for the list of endpoints once and only saw the first 100. An account with more endpoints than that would keep strays beyond the first page forever.
has_moremarker, so a response without it fails loudly instead of being silently treated as the whole list.Tests
test/integration/stripe/totest/shared/stripe/endpoints/, the mirror path for the module they test. The mutation gate only always runs mirror-located tests, so this move is what lets it prove the endpoint-limit recovery logic is guarded — the gate now kills all 99 mutants in the changed files (100%).at(-1)"last item" idiom joined the built-ins ignored by the constant-argument code-quality rule, since a third call site pushed it over that rule's threshold.