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

Fix multi region algorithms & Update Analytics with New Methods #98

Merged
merged 9 commits into from
Apr 19, 2024

Conversation

CahidArda
Copy link
Contributor

fixed issues in multi region fixed window:

  • ttl not set properly

fixed issues in multi region sliding window:

  • remaining was equal to the number of requests allowed per window in the first limit call.
  • remaining was not returned as an integer
  • synth method didn't calculate allCurrentIds as a set of ids, rather an array of ids which resulted in duplicates
  • synth method compared previous in db with current in all dbs. Changed it so that current in db is compared with current in all dbs

fixed issues:
- remaining was equal to the number of requests allowed per window in the first limit call.
- remaining was not returned as an integer
- synth method didn't calculate allCurrentIds as a set of ids, rather an array of ids which resulted in duplicates
- synth method compared previous in db with current in all dbs. Changed it so that current in db is compared with current in all dbs
Copy link

vercel bot commented Apr 17, 2024

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

Name Status Preview Comments Updated (UTC)
ratelimit-with-vercel-kv ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2024 0:27am

@CahidArda
Copy link
Contributor Author

we should wait for upstash/core-analytics#35 and bump dependency version, than tag ratelimit

@CahidArda CahidArda changed the title Fix multi region algorithms Fix multi region algorithms & Update Analytics with New Methods Apr 19, 2024
ogzhanolguncu
ogzhanolguncu previously approved these changes Apr 19, 2024
@ogzhanolguncu ogzhanolguncu merged commit 7b55833 into main Apr 19, 2024
2 of 3 checks passed
@CahidArda CahidArda deleted the fix-multi-region-algorithms branch April 25, 2024 07:14
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