Commit Graph

1442 Commits

Author SHA1 Message Date
kozabrada123 fde7f18d57 Fix example in readme for #456 (#475) 2024-01-31 22:53:13 +01:00
Dirk Stolle 282602d5c3 Update h2 to 0.3.24 to fix vulnerability RUSTSEC-2024-0003 (#474)
The update fixes a resource exhaustion vulnerability in h2 which
may lead to Denial of Service. For more information on that see
<https://rustsec.org/advisories/RUSTSEC-2024-0003>.
2024-01-31 22:47:46 +01:00
Dirk Stolle 750cc21b0a Bump actions/setup-node in GHA workflow to v4 (#472) 2024-01-31 22:43:54 +01:00
Dirk Stolle c5bfac66e5 Fix a few typos (#471) 2024-01-31 22:27:53 +01:00
bitfl0wer b8ba92cf07 Include license header everywhere 2024-01-30 17:19:34 +01:00
bitfl0wer 3f06cc011c Change license to Mozilla Public License v2.0 2024-01-30 10:03:14 +01:00
bitfl0wer 148ce74715 Change license to Mozilla Public License v2.0 2024-01-30 10:00:05 +01:00
Flori 9aa921ae32 Coverage (#468)
Up the reported coverage on coveralls by adding some missing tests,
especially for types. Also removes/replaces some old, faulty or
non-idiomatic code.

While unit testing might seem a bit bloaty (especially with this many
additions), I'd argue that writing somewhat sensible tests is the only
good way to somewhat reliably keep things from breaking in larger
projects/bigger codebases, such as these.

Most of these tests should, hopefully, be of acceptable quality,
although I do admit that when writing tests, I sometimes just like to
turn my brain off
2024-01-24 23:44:31 +01:00
bitfl0wer 60f55d9d3a exclude trivial id() functions from coverage 2024-01-24 23:26:59 +01:00
bitfl0wer 153bfc26c9 Add comment about test_self_updating_structs 2024-01-24 23:02:16 +01:00
bitfl0wer 9168e5b904 extend self updating structs test 2024-01-24 23:01:38 +01:00
bitfl0wer 9eb6260728 remove hit limit test 2024-01-24 18:51:10 +01:00
bitfl0wer b6f5d93e66 Add test for get_limit_config 2024-01-24 12:32:08 +01:00
bitfl0wer 764f86731d Add test to hit ratelimit 2024-01-24 12:21:46 +01:00
bitfl0wer f3771b31ca Remove PartialOrd from Emoji because unneccessary 2024-01-23 23:53:08 +01:00
bitfl0wer a564293fef Add Message PartialEq Test 2024-01-23 23:42:00 +01:00
bitfl0wer 96ef83270b Add partial_eq test for relationship.rs/Relationship 2024-01-23 23:31:35 +01:00
bitfl0wer 24cec523e0 Remove old/redundant code from attachment.rs 2024-01-23 23:11:37 +01:00
bitfl0wer fcd405939f Add to_public_user test 2024-01-23 23:06:24 +01:00
bitfl0wer c13ba6b291 Rename to_public_user into into_public_user 2024-01-23 23:06:14 +01:00
bitfl0wer 713f9d7846 Add unit tests for guild.rs entities 2024-01-23 21:13:15 +01:00
bitfl0wer b24714bc68 Remove Eq fromn Guild as it is not Eq 2024-01-23 21:05:01 +01:00
bitfl0wer f17fcb3c2c Create tests from to_str and from_str for GuildFeatures 2024-01-23 20:50:19 +01:00
bitfl0wer 3df3eae7ff APPEND: Remove unused imports 2024-01-23 19:08:35 +01:00
bitfl0wer 5e13f12cbd Replace usage of Arc<RwLock<...>> in public APIs with Shared<...> 2024-01-23 19:07:23 +01:00
bitfl0wer 9d543fcd27 Remove impl Eq from types that didn't qualify for Eq 2024-01-23 18:43:06 +01:00
bitfl0wer 0a0e6c3ffe write unit tests for config and entities 2024-01-22 20:57:29 +01:00
bitfl0wer c405162372 rustfmt 2024-01-22 20:57:17 +01:00
bitfl0wer a3bae6d312 Fix broken behaviour for ConfigEntity 2024-01-22 20:57:08 +01:00
Flori ed3786c0a6 "Self updating structs" API improvements (#467)
This PR slightly improves the ergonomics of working with self-updating
structs, by making the changes as documented in #466.
2024-01-22 15:19:24 +01:00
bitfl0wer 2209efc6a0 Loosen bounds on IntoShared<T> 2024-01-22 15:00:46 +01:00
bitfl0wer b521928f81 Make IntoShared trait with blanket implementation 2024-01-22 14:56:23 +01:00
bitfl0wer c4bea069b7 Fix errors by moving into_shared out of Composite 2024-01-22 14:50:33 +01:00
bitfl0wer b5923c30e2 Replace Arc, Rwlock with Shared 2024-01-21 20:24:17 +01:00
bitfl0wer 196a36a5fe Write documentation for observe 2024-01-21 20:13:00 +01:00
bitfl0wer bae0ce8b1f Add documentation for into_shared 2024-01-21 17:15:11 +01:00
bitfl0wer 400d4c74cf Rename to_shared to into_shared 2024-01-21 17:10:24 +01:00
bitfl0wer 22e8ca2a97 Define public method `to_shared` for dyn Composite 2024-01-21 17:07:54 +01:00
bitfl0wer 48fddb7378 rustfmt 2024-01-21 17:07:30 +01:00
bitfl0wer 39b1f1fa72 Replace use of Arc<RwLock<T>> with Shared<T> 2024-01-21 17:07:19 +01:00
bitfl0wer 92654989e8 Define type alias `Shared` 2024-01-21 17:06:43 +01:00
kozabrada123 163db42536 Minor instance updates (#465)
make Instance::from_url_bundle pub, update Instance docs
2024-01-20 13:15:13 +01:00
Flori 841a46f1ce merge main into dev (#464) 2024-01-19 21:55:29 +01:00
Flori 21a59b4d8a Update README.md 2024-01-19 21:55:05 +01:00
bitfl0wer e15c947d33 Merge branch 'main' of https://github.com/polyphony-chat/chorus 2024-01-19 21:50:44 +01:00
bitfl0wer bb1d565b55 bump version to 0.14.0 2024-01-19 21:50:42 +01:00
Flori bc2dbb8017 Version 0.14.0 (#463)
## Fixes

- Fix gateway heartbeat on WASM: #460

## Changes

- Update `GuildDefaults` to use new enums
- Make new enums derive `sqlx::Type`
- Feature lock UpdateMessage implementations

## Package changes

- Bump package version, especially reqwest from 0.11.22->0.11.23 -
removes need for custom git branch in Cargo.toml
2024-01-19 21:50:26 +01:00
Flori 65d9de88fe Fix gateway heartbeat on WASM (#460)
It turns out `std::time::Instant::now()` panics WASM (see #459) and
breaks the heartbeat handler.

This pr attempts to fix that by replacing `std::time::Instant` with
`wasmtimer::std::Instant` and `safina_timer::sleep_until` with
`wasmtimer::tokio::sleep_until`.
2024-01-19 17:24:48 +01:00
kozabrada123 7a878d03ac Revert "Mess w/ the tests to see if it really works"
This reverts commit 7b975e3c95.
2024-01-19 16:05:34 +01:00
kozabrada123 7b975e3c95 Mess w/ the tests to see if it really works 2024-01-19 15:53:24 +01:00