Commit Graph

1474 Commits

Author SHA1 Message Date
kozabrada123 539460a552 Fix voice_simple example 2024-07-25 11:27:30 +02:00
bitfl0wer feb2b1b64c
Bump browser_version according to https://www.useragents.me/#most-common-desktop-useragents 2024-07-24 21:55:10 +02:00
Flori e8469c8e4f
Use cargo nextest (#529)
This PR switches the `linux` job from `cargo test` to `cargo nextest
run` for > 50% time reduction in the test execution step of the CI
pipeline. Also, the "check common non default feature configurations"
step has been moved from the `linux` job to it's own job, to parallelize
the CI pipeline further and reduce the time that CI needs to run to
completion.
2024-07-24 16:24:26 +02:00
bitfl0wer d15dfc302d
Revert: nextest on wasm 2024-07-24 16:17:00 +02:00
bitfl0wer 31509b9945
forgor installing nextest 2024-07-24 16:12:06 +02:00
bitfl0wer f32b3060cf
Cargo nextest on wasm, Parallelize "Check common non-default feat. cfg." 2024-07-24 16:09:33 +02:00
bitfl0wer cc7ed62cf2
Merge branch 'dev' into nextest 2024-07-24 15:59:21 +02:00
bitfl0wer 7bb35e5ed8
Increase limit integer size to match spacebars' possibilities 2024-07-24 15:57:12 +02:00
bitfl0wer f0fc6eab4d
Fix testcase that relied on false behavior implemented by older spacebar servers 2024-07-24 15:55:49 +02:00
bitfl0wer dd85a7de17
Fix/Correct UnavailableGuild object 2024-07-24 15:55:29 +02:00
bitfl0wer 6bc6651e80
Remove redundant "build" step
I mean the bloody thing already gets built with "cargo test", so...
2024-07-24 14:06:10 +02:00
bitfl0wer 0bfab58f2f
Use cargo nextest 2024-07-24 14:00:40 +02:00
bitfl0wer 6cd3c1081b
Use cargo nextest 2024-07-24 13:58:19 +02:00
bitfl0wer 7a2666bde2
Update CONTRIBUTING.md 2024-07-24 13:37:07 +02:00
Flori 1285d702d7
Derives (#526)
Adds about one billion (+- a few hundred million) missing derives for
all sorts of types.

The biggest change in this PR is, how structs holding a property
`Shared<T>` types implement `PartialEq`. In previous versions of this
crate, if a `Shared<T>` was part of a struct, this or these properties
would be ignored in == comparisons. This is because `Shared<T>` is
defined as `Arc<RwLock<T>>` - meaning you'd have to lock the `RwLock` to
make a comparison. From now on, instead of ignoring these properties or
locking the inner `RwLock`, the pointer values of the `Arc<T>`'s get
compared. This is a cheap and exact way of ensuring `Eq` for types,
which have an inner `Shared<T>`.
2024-07-20 18:07:20 +02:00
bitfl0wer 76146b0e8c
Fix: Compile error with no default features 2024-07-20 17:54:49 +02:00
bitfl0wer 88efef6015
Fix: Turn unconditional import of sqlx::types::Json into conditional one 2024-07-20 17:30:21 +02:00
bitfl0wer 0beb4484ca
Fix: Wrong function name 2024-07-20 17:25:33 +02:00
bitfl0wer 599969e2c7
Merge branch 'one-billion-derives' of https://github.com/polyphony-chat/chorus into one-billion-derives 2024-07-20 17:21:52 +02:00
bitfl0wer 98b129aca0
Provide alternative implementations for PartialEq for some types when sqlx feature is enabled 2024-07-20 17:18:23 +02:00
bitfl0wer cd0230e64d
Provide alternative implementations for PartialEq for some types when sqlx feature is enabled 2024-07-20 16:54:47 +02:00
bitfl0wer 491cd255de
Add one BILLION derives 2024-07-18 23:04:35 +02:00
Flori b0667a33fb
Replace `Observer` and `GatewayEvent` with `pubserve` crate (#524)
This PR replaces our internal `Observer` trait with a more generic
version, as offered by our `pubserve` crate.

This also has the added benefit of removing the... creative logic used
in `Observer::unsubscribe()` which did not check the memory the internal
`Arc` points to, but rather some weird

```rs
self.observers
            .retain(|obs| format!("{:?}", obs) != to_remove);
```

which was written ages ago by a version of me that was still at the very
beginning of learning Rust
2024-07-13 18:03:02 +02:00
bitfl0wer ebcb6b65e4
Fix voice, voice_udp features 2024-07-13 14:53:04 +02:00
bitfl0wer 7554f90187
Replace `Observer` and `GatewayEvent` with `pubserve` crate 2024-07-13 14:28:22 +02:00
Flori 484c69229d
No openssl (#522)
* Remove openssl from some packages' deps

* Add shorthand wasm build script

* Eliminate openssl dependency from crate

* Build RootCertStore from webpki roots instead of native roots

* Expand wasm documentation

* Revert reqwest

* Lock reqwest at 0.11.23

* Lock reqwest at 0.11.26, latest possible version

* Add wasm test script
2024-07-13 08:31:45 +02:00
kozabrada123 743f106ec6
Miscellaneous fixes (#514)
- fix `PATCH /users/@me` - It incorrectly returned a required password error, even if the current password was set
- fix `GET /users/@me/guilds` - It incorrectly sent body parameters instead of query ones
- don't log debug! for every successful ratelimited request - use trace! so it's less spamy
- update the max expected compression ratio (several times) from 20 to 200. let's hope that will be enough
- fix deserialization errors relating to guild folders in user settings
- fix a panic in `SqlxBitFlags` if there are extra flags. It now truncates them
- update `chorus_macros` to 0.4.1 (due to the above fix)
- log (trace!) event data if we fail to parse it or it's unrecognised, for debugging purposes
- fix a deserialization error in the `MessageACK` event
- fix `public_flags` in user objects not being `PublicFlags` bitflags
2024-06-28 14:05:59 +02:00
Quat3rnion d59161619c
Add custom deserializer for PermissionOverwriteType (#512)
* Add custom deserializer for PermissionOverwriteType
2024-06-27 20:36:39 +02:00
Quat3rnion 39e7f89c78
Backend/guilds (#509)
* Fix SQL encode/decode for GuildFeatures

* Use distinct PermissionFlags type

* Add Emoji schema types, modify GuildBan with feature lock

* Add Schemas for pruning guild members

* Add schemas for interfacing with stickers backend routes

* Add schemas for interfacing with vanity-url backend routes

* Add schema for interfacing with guilds/id/welcome-screen route

* Make all Option<Vec> types Vec types with #[serde(default)]

* Add various types to support guilds/* api routes

* Add missing enums and structs for searching messages

* Use proper distinct types

* Add EmbedType enum

* Use distinct PermissionFlags type

* Changes supporting backend for VoiceState

* Changes supporting backend for AuditLog's
2024-06-27 08:45:51 +02:00
kozabrada123 89333d6353
Implement gateway options, zlib-stream compression (#508)
* feat: add GatewayOptions

* feat: implement zlib-stream compression

This also changes how gateway messages work.
Now each gateway backend converts its message into an
intermediary RawGatewayMessage, from which we inflate
and parse GatewayMessages.

Thanks to ByteAlex and their zlib-stream-rs crate, which
helped me understand how to parse a compressed websocket stream
2024-06-23 17:23:13 +02:00
Quat3rnion b4a8082f29
Update and add some types in support of the backend (#507) 2024-06-19 19:59:39 +02:00
kozabrada123 a7fc00df29
Bump chorus macros to 0.4.0 (#506)
- Bumps chorus macros to 0.4.0, followup to #505
- Makes builds within the repo use the local path and published releases
use a set version of the macros crate
2024-06-18 17:59:41 +02:00
kozabrada123 b3e62b2c33 always update to latest release of macros 2024-06-18 17:48:57 +02:00
kozabrada123 8d56259eac chorus macros 0.4.0 2024-06-18 17:35:39 +02:00
kozabrada123 3aec5881e5
Merge Quat3rnion/backend/messages (#505)
- Adds a multitude of new Types, Flags, and a few Objects relating to
sending and managing messages.
- Adds new SqlxBitFlag macro, which handles BitFlag objects being read
from/written to the database.
- Modifies some entities to use (new) Distinct Types instead of
primitives
2024-06-18 17:30:50 +02:00
kozabrada123 4430a7c4e6
Fix deserialization error w/ guild features list 2024-06-18 17:18:20 +02:00
Quat3rnion a8b7d9dfb3 u8 -> u64 2024-06-18 10:07:56 -04:00
Quat3rnion e553d10f25 Add new SerdeBitFlags derive macro, to help reduce repetitive code 2024-06-18 10:04:00 -04:00
Quat3rnion c9a36ce725 Maybe fix tests, make UserFlags able to be deserialized from String or u64 2024-06-18 08:46:07 -04:00
Quat3rnion d7de1d2fb7 Fix compilation for real, no dirty hack 2024-06-18 05:46:27 -04:00
Quat3rnion c27bc8d575 Fix test
I feel silly.
2024-06-18 05:34:03 -04:00
Quat3rnion abc4608be5 Dirty hack 2024-06-18 05:32:27 -04:00
Quat3rnion 77004abcfa Feature lock the macro 2024-06-18 05:24:42 -04:00
Quat3rnion 06b4dc3abd forgot a file :( 2024-06-18 05:19:51 -04:00
Quat3rnion 3810170400 Remove unused imports, feature locks in macro 2024-06-18 05:14:28 -04:00
Quat3rnion dfffcf4313 Add forgotten feature locks 2024-06-18 05:09:00 -04:00
Quat3rnion 6261cebfdf Fix test 2024-06-18 05:03:55 -04:00
Quat3rnion d8560093f5 Use chorus_macros from path, since it's there anyway 2024-06-18 04:48:50 -04:00
Quat3rnion bec0269e70 Add partial emoji and custom reaction types, refine SQLx mapping 2024-06-17 15:22:58 -04:00
Quat3rnion 590a6d6828 Make UserFlags deserialize from string 2024-06-07 14:08:47 -04:00