Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: double client side api rate limits #2043

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

ShubhamPalriwala
Copy link
Member

What does this PR do?

2x the client side api rate limiting values!

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

Copy link

vercel bot commented Feb 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated (UTC)
formbricks-cloud ⬜️ Ignored (Inspect) Feb 8, 2024 2:09pm
formbricks-com ⬜️ Ignored (Inspect) Feb 8, 2024 2:09pm

Copy link
Contributor

github-actions bot commented Feb 8, 2024

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
Contributor

packages/lib/constants.ts

Instead of using magic numbers for time intervals, it would be more readable to define constants for these values. This will make the code easier to understand and maintain.
Create Issue
See the diff
Checkout the fix

    const MINUTE = 60 * 1000;
    const HOUR = 60 * MINUTE;

    export const LOGIN_RATE_LIMIT = {
      interval: 15 * MINUTE,
      allowedPerInterval: 30,
    };

    export const CLIENT_SIDE_API_RATE_LIMIT = {
      interval: 5 * MINUTE,
      allowedPerInterval: 200,
    };

    export const SHARE_RATE_LIMIT = {
      interval: 1 * HOUR,
      allowedPerInterval: 30,
    };
git fetch origin && git checkout -b ReviewBot/Impro-2hkrpzu origin/ReviewBot/Impro-2hkrpzu

Copy link
Member

@mattinannt mattinannt left a comment

Choose a reason for hiding this comment

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

@ShubhamPalriwala thanks for the quick turnaround 🔥😊💪

@mattinannt mattinannt added this pull request to the merge queue Feb 8, 2024
Merged via the queue into main with commit 4b1bbf0 Feb 8, 2024
15 checks passed
@mattinannt mattinannt deleted the shubham/increase-rate-limiting-client-side-api branch February 8, 2024 14:25
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.

None yet

2 participants