Commit Graph

29 Commits

Author SHA1 Message Date
ckohen
26f927b9fe feat(Client): add apiResponse and apiRequest events (#6739)
Co-authored-by: Shubham Parihar <shubhamparihar391@gmail.com>
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: SpaceEEC <24881032+SpaceEEC@users.noreply.github.com>
2021-10-09 13:56:25 +02:00
Almeida
a194d9c37f refactor: use optional chaining (#6757) 2021-10-05 00:04:53 +02:00
Rodry
00bd92a451 refactor: ES2021 features (#6540)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: Voltrex <mohammadkeyvanzade94@gmail.com>
2021-09-03 12:58:01 +01:00
Justin
be5c0eff34 chore: update discord domain name (#6214) 2021-07-29 02:54:08 +01:00
Antonio Román
5ca97c9351 refactor: remove timer utilities from Client (#6113) 2021-07-16 13:31:25 +01:00
Shubham Parihar
1ac9a2eb5b refactor(*): make typedefs for all options params (#5785)
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-06-13 19:32:54 +01:00
SpaceEEC
18ac72e457 feat(RequestHandler): emit more info when a rate limit was hit (#5801)
* feat(RequestHandler): emit more info when a rate limit was hit

* emit 'None' when no sublimit was hit

Co-authored-by: Antonio Román <kyradiscord@gmail.com>

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
2021-06-10 17:06:11 +01:00
Ven
16f261e773 feat(Rest): optional ratelimit errors (#5659)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
2021-06-09 08:45:04 +01:00
Vlad Frangu
ef92339d07 feat(Rest): show the data that is sent to Discord when an errors occurs (#5701) 2021-06-03 09:35:09 +01:00
Antonio Román
14c6802438 refactor(Deps): use async-queue package (#5662) 2021-05-22 21:10:20 +02:00
ckohen
a5d41c9f6c refactor(RequestHandler): use x-ratelimit-reset-after when present (#5511) 2021-04-30 21:48:37 +02:00
Alec Woods
9d2d60691e feat(Rest): better handling of global rate limit and invalid request tracking (#4711)
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
Co-authored-by: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com>
Co-authored-by: Papaia <43409674+Papaia@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-03-31 21:56:58 +02:00
Sugden
ee5bc1a5c4 refactor: switch api and gateway to V8 (#4879)
Co-authored-by: Jan <66554238+Vaporox@users.noreply.github.com>
2021-02-11 18:10:35 +01:00
Noel
0a591a9697 feat(Browser): remove browser � (#5113) 2020-12-14 13:56:16 +01:00
Antonio Román
d2341654fe fix(Rest): resolved a regression, added retried AbortError (#4852) 2020-09-29 18:05:54 +02:00
Antonio Román
32fe72f909 feat(Rest): switch queue to AsyncQueue (#4835)
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
2020-09-25 23:42:24 +02:00
SpaceEEC
7b38f46caf fix(RequestHandler): a global timeout implies limited (#3950) 2020-03-17 09:02:51 +01:00
Crawl
c065156a88 chore: consistency/prettier (#3852)
* chore: consistency/prettier

* chore: rebase

* chore: rebase

* chore: include typings

* fix: include typings file in prettier lint-staged
2020-02-29 14:35:57 +01:00
Crawl
3a0470b45c chore(deps): update deps and fix lint (#3833) 2020-02-24 23:14:31 +01:00
Reseq64
6be5051f92 typo(RequestHandler): fix spelling of 'requests' (#3196)
Removed the additional "s" to "requessts"
2019-04-10 17:07:50 +02:00
SpaceEEC
089f65fd2a fix(RequestHandler): pass HTTPError pass path instead of route as path 2019-04-03 22:45:51 +02:00
Vlad Frangu
3f5161eb76 fix: Internal Sharding, this time fixed™ (#3140)
* src: WIP Internal Sharding refactor

* src: Refactor unavailable guild check
Co-Authored-By: kyranet <kyradiscord@gmail.com>

* src: More WIP Code
F in the chat to the old manager

* src: It should work but Discord says no.
Seriously why is this not working!

* fix: Inflator causing issues

* src: Finishing touches and typings

* misc: Proper debug message

* fix: Making things hidden needs writable: true as well

* fix: Sharding allowing multiple of the same shard, negative shards or strings

* fix: Again... edge cases
I love you guys .w.

* misc: Touchups

* misc: Better error?

* docs: Typo

* typings: Requested changes

* src: Requested changes

* src: Fix issues, validate provided shard options and more

* src: Forgot to remove the listener

* lint: eslint complaining

* fix: Setting shardCount to auto crashing the process

* misc: Requested changes

* typings: Correct typings for shardCount client option

* typings: Add invalidSession event to the shard and correct typings

* src: Minor docs adjustements, and code consistency between setHelloTimeout and setHeartbeatTimeout

* src: Don't block reconnect while creating shards
Might fix silent disconnects *again*

* src: Prevent reconnect from running if the Manager isn't READY
That way, if a shard dies while we're still spawning, it won't cause issues

* fix: Retry to reconnect if there's a network error going on.
The manager *should* keep reconnecting unless the token is invalid

* src: Enhance onClose handler for shards in the manager
- If the close code is between 1000 and 2000 (inclusive), you cannot resume
I tested this locally
- If there's a session ID still present, immediately try to resume
Faster resumes :papaBless:
Otherwise, the invalid session event will trigger and it'll handle accordingly

I swear if I see a SINGULAR Silent DC I'm yeeting

* src: Fix error check

* src: Make sure message exists on the error

* src: Used the wrong property for the shardQueue

* src: Make the hello timeout be made by the client
god help

* docs: Correct docs for WSEvents

* misc: Remove old events from the Events constant

* src: Throw the HTTP error if we don't get a 401

* typings: Can't forget about them

* src: Implement some more fail safes just in case
Seriously, better safe than sorry! Gotta failproof it completely
2019-04-01 09:43:45 +02:00
Gus Caplan
42505b78c1 chore: add strict mode (#2974) 2018-12-03 15:19:10 -06:00
SpaceEEC
ead99a53b7 fix(HTTPError): the path property should actually be the path 2018-09-02 14:57:36 +02:00
Isabella
be4d6f9dc3 feat: add ClientOptions#retryLimit (#2805)
* feat: add ClientOptions#retryLimit

* hydra needs to learn how to code right

* a default would probably help

* move incrementor & update comment

* clarify docs on Infinity
2018-09-01 04:51:35 +02:00
Lewdcario
f75b80d96b docs: add docstring to HTTPError 2018-08-30 16:31:22 -06:00
Kyra
989c365ef1 fix: Better global ratelimit management (#2801)
* fix: better global ratelimit handling in RequestHandler

fix: Remove useless line

fix: Better global ratelimit management

* refactor: Changed RESTManager#globallyRateLimited to be a getter

* refactor: Remove RESTManager#globallyRateLimited getter

* docs: Updated comments to reflect latest changes
2018-08-28 18:28:21 -05:00
bdistin
f326fe67b1 fix: reactions ratelimits (#2795)
* each reaction doesn't have it's own ratelimit

* fix hard-coded reset for reacting
2018-08-28 18:25:38 -05:00
Isabella
13f46b924b refactor: clean up rate limit handling (#2694)
* refactor: clean up rate limit handling

* requested changes

* remove request mode option

* fix dupe requests

* hardcode reaction ratelimits

* suggested changes

* fix small thing

* re-add restTimeOffset

* move restTimeOffset a bit

* i swear i know english its my native language ok

* requested changes

* fix: a bit *too* pre-emptive with ratelimits, now less so

* fix: dapi error shoudl reject with path

* fix: make errors in execute catchable

* fix promise return

* rebase is hard
2018-08-24 06:29:44 +02:00