Skip to content

fix(core): reject non-finite rate limit values - #581

Open
ashutoshpalhare wants to merge 3 commits into
codercops:devfrom
ashutoshpalhare:fix/452-finite-rate-limit-values
Open

ashutoshpalhare wants to merge 3 commits into
codercops:devfrom
ashutoshpalhare:fix/452-finite-rate-limit-values

Conversation

@ashutoshpalhare

Copy link
Copy Markdown

What does this change?

Closes #

How I tested this

AI assistance

Checklist

  • This PR targets dev
  • I was assigned the linked issue
  • pnpm -r build, pnpm test and pnpm -r typecheck pass locally
  • Tests added or updated where it makes sense
  • For a bug fix: the new test fails without my change
  • Changeset added (pnpm changeset) if this changes core, widget or server
  • pnpm api run and api/ committed if an exported type or option changed
  • Docs updated if behavior or options changed

@anurag629 anurag629 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ashutoshpalhare, the change is right. packages/core/src/limits/rate-limit.ts:59-60 now rejects NaN and Infinity for both limit and windowMs, as we settled in #452, and the new cases in packages/core/tests/limits/rate-limit.test.ts cover all four. The description is still the empty template, though, so two things before it can go in:

  1. Closes # has no number, so the PR isn't linked to #452. Make it Closes #452, or the claim check fails.
  2. "How I tested this" and "AI assistance" are empty. CONTRIBUTING.md asks for both: what you ran to check it, and either "none" or the tool and what you used it for. The description check fails while either one is empty.

Editing the description is enough, no new commit needed.

@anurag629

Copy link
Copy Markdown
Member

Hey @ashutoshpalhare, just checking in on this one. The code change is right, only the description is missing: Closes #452, plus the "How I tested this" and "AI assistance" sections, which are still the empty template. Editing the description is enough, no new commit needed. If there's no update by Nov 11, I'll free #452 so someone else can pick it up, as CONTRIBUTING describes.

This branch has not been deployed

No deployments
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