Prevents events from being added to broadcast streams before the client is returned from Nyxx.connectGateway (or, at least, until the user is able to access the event streams e.g via plugins).
Also fixes an issue where using getters and Stream.map caused every gateway event to be parsed multiple times, scaling with the number of listeners on the client's event streams.
Also fixes an issue where IDENTIFY calls were not rate limited if they were not made as part of the initial Gateway connection (e.g during a reconnect).
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
Checklist:
[x] Ran dart analyze or make analyze and fixed all issues
[x] Ran dart format --set-exit-if-changed -l 160 ./lib or make format and fixed all issues
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[ ] I have added tests that prove my fix is effective or that my feature works
Description
Prevents events from being added to broadcast streams before the client is returned from
Nyxx.connectGateway
(or, at least, until the user is able to access the event streams e.g via plugins).Also fixes an issue where using getters and
Stream.map
caused every gateway event to be parsed multiple times, scaling with the number of listeners on the client's event streams.Also fixes an issue where
IDENTIFY
calls were not rate limited if they were not made as part of the initial Gateway connection (e.g during a reconnect).Type of change
Checklist:
dart analyze
ormake analyze
and fixed all issuesdart format --set-exit-if-changed -l 160 ./lib
ormake format
and fixed all issues