Commit Graph

32 Commits

Author SHA1 Message Date
SpecificProtagonist f97d26bc6c
Fix gateway heartbeat blocking (#162)
fix gateway heartbeat blocking
2023-07-21 13:59:40 +02:00
Flori 9953d9e299
Bump crate versions (#158) 2023-07-17 20:06:57 +02:00
Zert3x d5979e0024
Async Observer Trait (#147) 2023-07-11 19:20:27 +02:00
Flori 8c9ccdd997
Ratelimiter overhaul (#144)
* Rename limits and limit to have better names

* Remove empty lines

* Remove handle_request (moved to requestlimiter)

* Start working on new ratelimiter

* Make limits Option, add "limited?" to constructor

* Add missing logic to send_request

* Rename Limits

* Create Ratelimits and Limit Struct

* Define Limit

* Import Ratelimits

* Define get_rate_limits

* Remove unused import

* + check_rate_limits & limits_config_to_ratelimits

* Remove Absolute Limits
These limits are not meant to be tracked anyways.

* add ratelimits is_exhausted

* Add error handling and send request checking

* change limits to option ratelimits

* Add strum

* Change Ratelimits to Hashmap

* Remove ratelimits in favor of hashmap

* Change code from struct to hashmap

* start working on update rate limits

* Remove wrong import

* Rename ChorusLibError to ChorusError

* Documented the chorus errors

* Made error documentation docstring

* Make ReceivedErrorCodeError have error string

* Remove unneeded import

* Match changes in errors.rs

* Improve update_rate_limits and can_send_request

* add ratelimits.to_hash_map()

* use instances' client instead of new client

* add LimitsConfiguration to instance

* improve update_limits, change a method name

* Fix un-updated errors

* Get LimitConfiguration in a sane way

* Move common.rs into ratelimiter::ChorusRequest

* Delete common.rs

* Make instance.rs use overhauled errors

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* update ratelimiter implementation across all files

* Fix remaining errors post-refactor

* Changed Enum case to be correct

* Use result

* Re-add missing body to request

* Remove unneeded late initalization

* Change visibility from pub to pub(crate)
I feel like these core methods don't need to be exposed as public API.

* Remove unnecessary import

* Fix clippy warnings

* Add docstring

* Change Error names across all files

* Update Cargo.toml

Strum is not needed

* Update ratelimits.rs

* Update ratelimits.rs

* Bug/discord instance info unavailable (#146)

* Change text to be more ambigous

* Use default Configuration instead of erroring out

* Emit warning log if instance config cant be gotten

* Remove import

* Update src/instance.rs

Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>

* Add missing closing bracket

* Put limits and limits_configuration as one struct

* Derive Hash

* remove import

* rename limits and limits_configuration

* Save clone call

* Change LimitsConfiguration to RateLimits
`LimitsConfiguration` is in no way related to whether the instance has API rate limits enabled or not. Therefore, it has been replaced with what it should have been all along.

* Add ensure_limit_in_map(), add `window` to `Limit`

* Remove unneeded var

* Remove import

* Clean up unneeded things
Dead code warnings have been supressed, but flagged as FIXME so they don't get forgotten. Anyone using tools like TODO Tree in VSCode can still see that they are there, however, they will not be shown as warnings anymore

* Remove nested submodule `limit`

* Add doc comments

* Add more doc comments

* Add some log messages to some methods

---------

Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
2023-07-09 18:38:02 +02:00
kozabrada123 ce359103da Use log instead of prints 2023-07-01 19:29:50 +02:00
Vincent Junge 1b1aa564d2
fixed tokio features 2023-06-24 08:52:45 +02:00
Vincent Junge 29fcdfe641
simplyfy Snowflake 2023-06-20 12:21:22 +02:00
bitfl0wer 5732f1119f
Add rusty-hook for pre-push cargo fmt 2023-05-28 00:52:11 +02:00
kozabrada123 f54e750f74 Add options with empty string for identify props 2023-05-27 19:55:57 +02:00
kozabrada123 a26ded8ab2
Merge branch 'main' into feature/full-gateway-coverage 2023-05-27 19:23:27 +02:00
kozabrada123 013943791b Types refactor merged 2023-05-26 19:36:41 +02:00
Zertex bb7b7a57e3 Use patched version of sqlx 2023-05-26 13:02:07 -04:00
Zertex 351d0ae6d2 Make client feature default 2023-05-26 10:16:24 -04:00
Zertex e0518db6a9 Add features to Cargo.toml 2023-05-26 10:09:55 -04:00
Zertex f964a2d303 Serde_repr on ChannelType 2023-05-26 09:58:13 -04:00
bitfl0wer 5dc1441ac6
Integrate polyphony-types into chorus 2023-05-25 21:11:08 +02:00
kozabrada123 68e47f03e7 Merge branch 'main' 2023-05-22 13:30:19 +02:00
bitfl0wer b5b032c37e
Create integration.rs, is broken right now 2023-05-20 21:04:03 +02:00
kozabrada123 ea4dfc82d5 Update dependencies, deserialize errors 2023-05-20 08:39:02 +02:00
kozabrada123 dad2ad3bec Solve deserialization problem semi optimally 2023-05-17 18:16:47 +02:00
kozabrada123 5bece07ab7 Add more events, fix deserialization errors 2023-05-14 08:20:25 +02:00
kozabrada123 3cac8c18c0 Add a few more gateway events 2023-05-13 16:24:34 +02:00
bitfl0wer 175d40209f
cool i have written a memory hog 2023-05-11 00:06:13 +02:00
bitfl0wer 3236d462ff
Add multipart feature 2023-05-05 14:38:05 +02:00
bitfl0wer 4956e44c0a
implement Gateway::new() 2023-04-28 23:21:55 +02:00
bitfl0wer 493471dc02
add rt-multi-thread feature 2023-04-28 20:30:31 +02:00
bitfl0wer 87d9d14047
Add dependencies 2023-04-25 17:21:27 +02:00
bitfl0wer 552b43f80b
Replace Custom Error boilerplate with macro 2023-04-21 15:04:58 +02:00
bitfl0wer e919e71819
Added email regex validation and tests 2023-04-16 14:09:23 +02:00
bitfl0wer 1c39d94e84
Add tokio and serde features 2023-04-10 14:18:17 +02:00
bitfl0wer d2a10d070d
add chrono as it will be needed for epoch time 2023-04-07 21:01:21 +02:00
bitfl0wer 19ebda2887
cargo init 2023-04-04 16:42:20 +02:00