Skip to content

fix(api): improve speed parameter validation and bounds handling#208

Open
Shweta2117409 wants to merge 2 commits into
JhaSourav07:mainfrom
Shweta2117409:fix/speed-validation
Open

fix(api): improve speed parameter validation and bounds handling#208
Shweta2117409 wants to merge 2 commits into
JhaSourav07:mainfrom
Shweta2117409:fix/speed-validation

Conversation

@Shweta2117409
Copy link
Copy Markdown

Description

Fixes #163

Improved speed parameter validation by enforcing safe animation bounds and graceful fallback handling.

Changes made

  • Added min/max bounds validation for speed

  • Invalid or extreme values now fallback to default 8s

  • Added tests covering:

    • invalid formats
    • below minimum bounds
    • above maximum bounds
  • Updated README parameter documentation for valid speed range

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

N/A (validation + test improvements only)

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format.
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard.
  • (Recommended) I joined the CommitPulse Discord server for faster collaboration, mentorship, and PR support.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 19, 2026

@Shweta2117409 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

👋 Hey @Shweta2117409, welcome to CommitPulse! 🎉

Thanks for opening your first pull request — this is a big deal and we appreciate the effort!

While you wait for a review, please double-check:

  • ✅ You've read the CONTRIBUTING.md checklist
  • npm run lint, npm run format, and npm run test all pass locally
  • ✅ Your PR has a visual preview if it touches any SVG output
  • 💬 You've joined our Discord for faster PR feedback

A maintainer will review your PR shortly. Hang tight! 🚀

@Shweta2117409
Copy link
Copy Markdown
Author

Implemented safer speed parameter validation with:

  • min/max bounds handling
  • graceful fallback to default 8s
  • additional unit tests
  • README documentation updates

All lint, tests, and typechecks are passing.

@Shweta2117409
Copy link
Copy Markdown
Author

Closing this duplicate PR and continuing work in #208.

@Shweta2117409
Copy link
Copy Markdown
Author

All local checks, tests, linting, and production build are passing successfully. The remaining Vercel check appears to be deployment authorization-related for external contributors.

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.

enhancement(api): improve speed param validation and error messaging

1 participant