Commit Graph

26 Commits

Author SHA1 Message Date
isonmad
dd31ee0c5f propagate errors in ClientManager.destroy (#844)
If the promise returned by logout() rejects, previously
it would be completely uncaught, and just return an
eternally pending promise that never resolved.

Related to pull requests #828 and #839.
2016-10-27 11:33:51 +01:00
Amish Shah
00fe45f6b3 simplify client destruction 2016-10-26 19:52:41 +01:00
Amish Shah
7d04863b66 Revert "fix Client.destroy bugs" (#839) 2016-10-26 17:30:18 +01:00
isonmad
e9fa8a438c fix Client.destroy bugs (#828)
* add test for Client.destroy()

* propagate errors in ClientManager.destroy

If the promise returned by logout() rejects, previously
it would be completely uncaught, and just return an
eternally pending promise that never resolved.

* fix RESTMethods.logout

Without a data argument, the POST that superagent sends causes
the discord server to reply with a HTTP 400 error:

text: '{"Content-Type": "Expected Content-Type to be one of set([\'application/json\'])."}',

* fix Client.destroy

_timeouts and _intervals were changed to Set objects in
commit 6ede7a32fd a month ago.

Changing them to arrays causes failures if you try to reuse
the client object again.

* always close websocket in ClientManager.destroy

Invoking logout does not implicitly cause the server to close
the websocket for you, so cleanup everything.

Otherwise the websocket being open keeps node alive and hanging
mysteriously until the connection hits a timeout.

* fix indentation for eslint
2016-10-26 14:49:45 +01:00
Schuyler Cebulskie
492f706035 Fix Gus' log messages 2016-10-13 20:05:07 -04:00
Gus Caplan
96355a4968 add constants, some debug stuff (#791)
* add constants, some debug stuff

* i can't believe i did this
2016-10-10 20:53:54 +01:00
Gus Caplan
c8636fd277 fix heartbeat (#737) 2016-09-24 23:56:18 -07:00
Gus Caplan
bd1449bc5a make login sane (#735) 2016-09-24 17:55:31 +01:00
Schuyler Cebulskie
47d873a8ca Move and improve debug/warn docs 2016-09-19 05:11:35 -04:00
Schuyler Cebulskie
6a94658dd7 Clean up some stuff 2016-09-19 04:32:24 -04:00
Schuyler Cebulskie
7d8667694d Fix massive timeout/interval memory leaks 2016-09-19 03:49:42 -04:00
Gus Caplan
7cb2e8eef7 add disconnect event, document warn and debug events (#702)
* add documentation for events, and add a disconnect event, because i know people use that

* generate docs, and fix a hastily copied docstring

* fix permissions freak out
2016-09-14 00:12:10 -04:00
Schuyler Cebulskie
47d71d32f3 Make grammer gooder 2016-09-11 01:40:37 -04:00
Amish Shah
7475f734ac Add debug stuff 2016-09-04 12:31:16 +01:00
Amish Shah
9c915d1e0a Fix constants errors not giving a stacktrace 2016-09-04 11:53:48 +01:00
Schuyler Cebulskie
0b908f5bce Cleanup Part 2: Electric Boogaloo (Reloaded) (#594)
* Cleanup Part 2: Electric Boogaloo (Reloaded)

* Moar cleanup

* Tweak NOT_A_PERMISSION error
2016-09-04 10:08:09 +01:00
Schuyler Cebulskie
68acf37fd4 Add stricter/better ESLint config (#589)
* Add stricter/better ESLint config

* Remove more unnecessary @returns
2016-09-03 20:45:23 +01:00
Amish Shah
a172fffd76 Actually add GUILD_SYNC 2016-09-03 17:59:16 +01:00
Schuyler Cebulskie
27652b94af Make JSDocs follow general conventions (#582)
* Make JSDocs follow usual conventions

* Fix StringResolvable name

* Make function lowercase
2016-09-03 09:57:25 +01:00
Amish Shah
d249aa10cc Add client.destroy(); 2016-08-30 13:05:57 +01:00
Amish Shah
144638e746 Experimental ClientOptions.fetch_all_members 2016-08-29 13:54:35 +01:00
Amish Shah
8d5d90e222 Remove all data stores! Move to maps 2016-08-19 22:35:03 +01:00
Amish Shah
871c60c8dd fix client manager docs oops 2016-08-19 00:33:53 +01:00
Amish Shah
e0c987c1b2 add docs for ClientManager 2016-08-19 00:33:15 +01:00
Amish Shah
b8db4c4f4b ESLint stuff... 2016-08-13 14:44:49 +01:00
hydrabolt
9956e43c8e initial 2016-04-16 22:58:49 +01:00