-
Notifications
You must be signed in to change notification settings - Fork 30
feat(Rest): improve global rate limit and invalid request tracking #51
Conversation
Codecov Report
@@ Coverage Diff @@
## main #51 +/- ##
==========================================
- Coverage 89.98% 88.82% -1.16%
==========================================
Files 8 8
Lines 1108 1342 +234
Branches 109 142 +33
==========================================
+ Hits 997 1192 +195
- Misses 3 9 +6
- Partials 108 141 +33
Continue to review full report at Codecov.
|
Edit: this will be hardcoded around for the only known sublimit in the next commit |
208fd44
to
54887c2
Compare
Okay, significant refactor to sublimit handling, here's how it should work now:
|
Test have been added to cover everything that has changed! |
e269c8a
to
ef22765
Compare
I totally forgot I still had this PR open 🤦 , addressed changes and rebased. |
92306de
to
854e20a
Compare
010c6cf
to
27d21ab
Compare
6fa1463
to
7e3e1b4
Compare
Ported from discordjs/discord.js#4711 refactor(SequentialHandler): use timers/promises refactor(SequentialHandler): move global checks to each request Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> fix: separate queue for sub limits refactor(SequentialHandler): address PR comments Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> refactor(SequentialHandler): better sublimit handling refactor: address pr comments Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com> Co-Authored-By: Antonio Román <kyradiscord@gmail.com> Co-Authored-By: Noel <icrawltogo@gmail.com> test: add sublimit tests refactor(Util): only check route once refactor: rename globalLimit Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> fix: address pr comments Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> refactor(Utils): use enum Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Update packages/rest/src/lib/handlers/SequentialHandler.ts
674fdd7
to
c18f541
Compare
Please describe the changes this PR makes and why it should be merged:
Ported from discordjs/discord.js#4711
The logic is all taken pretty much directly. This is the start of a series of PRs to catch up the REST module to discord.js v13s built-in REST implementation.
Status and versioning classification: