From f5f70287e7c317614e5ebed4fec7a44d18177497 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Thu, 10 Aug 2023 09:40:41 +0100 Subject: [PATCH 1/5] feat: add `SENTRY_DSN` env variable --- Cargo.lock | 16 ++++++++-------- crates/bonfire/Cargo.toml | 10 +++++++--- crates/core/database/Cargo.toml | 10 +++++----- crates/core/models/Cargo.toml | 4 ++-- crates/core/permissions/Cargo.toml | 14 +++++++------- crates/core/presence/Cargo.toml | 4 ++-- crates/core/result/Cargo.toml | 14 +++++++------- crates/delta/Cargo.toml | 25 +++++++++++++++++-------- crates/quark/Cargo.toml | 24 +++++++++++++----------- crates/quark/src/util/log.rs | 20 ++++++++++++-------- 10 files changed, 80 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9d23d056..9a91f047 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2858,7 +2858,7 @@ dependencies = [ [[package]] name = "revolt-bonfire" -version = "0.6.5" +version = "0.6.6" dependencies = [ "async-std", "async-tungstenite", @@ -2875,7 +2875,7 @@ dependencies = [ [[package]] name = "revolt-database" -version = "0.6.5" +version = "0.6.6" dependencies = [ "async-recursion", "async-std", @@ -2907,7 +2907,7 @@ dependencies = [ [[package]] name = "revolt-delta" -version = "0.6.5" +version = "0.6.6" dependencies = [ "async-channel", "async-std", @@ -2948,7 +2948,7 @@ dependencies = [ [[package]] name = "revolt-models" -version = "0.6.5" +version = "0.6.6" dependencies = [ "indexmap", "iso8601-timestamp 0.2.11", @@ -2961,7 +2961,7 @@ dependencies = [ [[package]] name = "revolt-permissions" -version = "0.6.5" +version = "0.6.6" dependencies = [ "async-std", "async-trait", @@ -2975,7 +2975,7 @@ dependencies = [ [[package]] name = "revolt-presence" -version = "0.6.5" +version = "0.6.6" dependencies = [ "async-std", "log", @@ -2986,7 +2986,7 @@ dependencies = [ [[package]] name = "revolt-quark" -version = "0.6.5" +version = "0.6.6" dependencies = [ "async-lock", "async-recursion", @@ -3039,7 +3039,7 @@ dependencies = [ [[package]] name = "revolt-result" -version = "0.6.5" +version = "0.6.6" dependencies = [ "revolt_okapi", "revolt_rocket_okapi", diff --git a/crates/bonfire/Cargo.toml b/crates/bonfire/Cargo.toml index baff48b8..f787b979 100644 --- a/crates/bonfire/Cargo.toml +++ b/crates/bonfire/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-bonfire" -version = "0.6.5" +version = "0.6.6" license = "AGPL-3.0-or-later" edition = "2021" @@ -25,7 +25,11 @@ serde = "1.0.136" # async futures = "0.3.21" async-tungstenite = { version = "0.17.0", features = ["async-std-runtime"] } -async-std = { version = "1.8.0", features = ["tokio1", "tokio02", "attributes"] } +async-std = { version = "1.8.0", features = [ + "tokio1", + "tokio02", + "attributes", +] } # core -revolt-presence = { path = "../core/presence", features = [ "redis-is-patched" ] } +revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] } diff --git a/crates/core/database/Cargo.toml b/crates/core/database/Cargo.toml index f4880144..0546d1bb 100644 --- a/crates/core/database/Cargo.toml +++ b/crates/core/database/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-database" -version = "0.6.5" +version = "0.6.6" edition = "2021" license = "AGPL-3.0-or-later" authors = ["Paul Makles "] @@ -22,10 +22,10 @@ default = ["mongodb", "async-std-runtime"] [dependencies] # Core -revolt-result = { version = "0.6.5", path = "../result" } -revolt-models = { version = "0.6.5", path = "../models" } -revolt-presence = { version = "0.6.5", path = "../presence" } -revolt-permissions = { version = "0.6.5", path = "../permissions", features = [ +revolt-result = { version = "0.6.6", path = "../result" } +revolt-models = { version = "0.6.6", path = "../models" } +revolt-presence = { version = "0.6.6", path = "../presence" } +revolt-permissions = { version = "0.6.6", path = "../permissions", features = [ "serde", "bson", ] } diff --git a/crates/core/models/Cargo.toml b/crates/core/models/Cargo.toml index 992f524f..113e29bb 100644 --- a/crates/core/models/Cargo.toml +++ b/crates/core/models/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-models" -version = "0.6.5" +version = "0.6.6" edition = "2021" license = "AGPL-3.0-or-later" authors = ["Paul Makles "] @@ -18,7 +18,7 @@ default = ["serde", "partials"] [dependencies] # Core -revolt-permissions = { version = "0.6.5", path = "../permissions" } +revolt-permissions = { version = "0.6.6", path = "../permissions" } # Serialisation indexmap = "1.9.3" diff --git a/crates/core/permissions/Cargo.toml b/crates/core/permissions/Cargo.toml index 637fb052..4fa89fed 100644 --- a/crates/core/permissions/Cargo.toml +++ b/crates/core/permissions/Cargo.toml @@ -1,18 +1,18 @@ [package] name = "revolt-permissions" -version = "0.6.5" +version = "0.6.6" edition = "2021" license = "AGPL-3.0-or-later" -authors = [ "Paul Makles " ] +authors = ["Paul Makles "] description = "Revolt Backend: Permission Logic" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] bson = ["dep:bson"] -serde = [ "dep:serde" ] -schemas = [ "dep:schemars" ] -try-from-primitive = [ "dep:num_enum" ] +serde = ["dep:serde"] +schemas = ["dep:schemars"] +try-from-primitive = ["dep:num_enum"] [dev-dependencies] @@ -30,7 +30,7 @@ async-trait = "0.1.51" # Serialisation serde = { version = "1", features = ["derive"], optional = true } -bson = { version = "2.1.0", optional = true} +bson = { version = "2.1.0", optional = true } # Spec Generation -schemars = { version = "0.8.8", optional = true } \ No newline at end of file +schemars = { version = "0.8.8", optional = true } diff --git a/crates/core/presence/Cargo.toml b/crates/core/presence/Cargo.toml index a85425c2..67bc9f05 100644 --- a/crates/core/presence/Cargo.toml +++ b/crates/core/presence/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "revolt-presence" -version = "0.6.5" +version = "0.6.6" edition = "2021" license = "AGPL-3.0-or-later" -authors = [ "Paul Makles " ] +authors = ["Paul Makles "] description = "Revolt Backend: User Presence" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/core/result/Cargo.toml b/crates/core/result/Cargo.toml index cf99e30e..9907aad3 100644 --- a/crates/core/result/Cargo.toml +++ b/crates/core/result/Cargo.toml @@ -1,20 +1,20 @@ [package] name = "revolt-result" -version = "0.6.5" +version = "0.6.6" edition = "2021" license = "AGPL-3.0-or-later" -authors = [ "Paul Makles " ] +authors = ["Paul Makles "] description = "Revolt Backend: Result and Error types" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -serde = [ "dep:serde" ] -schemas = [ "dep:schemars" ] -rocket = [ "dep:rocket", "dep:serde_json" ] -okapi = [ "dep:revolt_rocket_okapi", "dep:revolt_okapi" ] +serde = ["dep:serde"] +schemas = ["dep:schemars"] +rocket = ["dep:rocket", "dep:serde_json"] +okapi = ["dep:revolt_rocket_okapi", "dep:revolt_okapi"] -default = [ "serde" ] +default = ["serde"] [dependencies] # Serialisation diff --git a/crates/delta/Cargo.toml b/crates/delta/Cargo.toml index 668cba53..e7466efa 100644 --- a/crates/delta/Cargo.toml +++ b/crates/delta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-delta" -version = "0.6.5" +version = "0.6.6" license = "AGPL-3.0-or-later" authors = ["Paul Makles "] edition = "2018" @@ -38,29 +38,38 @@ futures = "0.3.8" chrono = "0.4.15" async-channel = "1.6.1" reqwest = { version = "0.11.4", features = ["json"] } -async-std = { version = "1.8.0", features = ["tokio1", "tokio02", "attributes"] } +async-std = { version = "1.8.0", features = [ + "tokio1", + "tokio02", + "attributes", +] } # internal util lettre = "0.10.0-alpha.4" # web -rocket = { version = "0.5.0-rc.2", default-features = false, features = ["json"] } +rocket = { version = "0.5.0-rc.2", default-features = false, features = [ + "json", +] } rocket_empty = { version = "0.1.1", features = ["schema"] } rocket_authifier = { version = "1.0.7" } rocket_prometheus = "0.10.0-rc.3" # spec generation schemars = "0.8.8" -revolt_rocket_okapi = { version = "0.9.1", features = [ "swagger" ] } +revolt_rocket_okapi = { version = "0.9.1", features = ["swagger"] } # quark revolt-quark = { path = "../quark" } # core -revolt-database = { path = "../core/database", features = [ "rocket-impl", "redis-is-patched" ] } -revolt-models = { path = "../core/models", features = [ "schemas", "validator" ] } -revolt-result = { path = "../core/result", features = [ "rocket", "okapi" ] } -revolt-permissions = { path = "../core/permissions", features = [ "schemas" ] } +revolt-database = { path = "../core/database", features = [ + "rocket-impl", + "redis-is-patched", +] } +revolt-models = { path = "../core/models", features = ["schemas", "validator"] } +revolt-result = { path = "../core/result", features = ["rocket", "okapi"] } +revolt-permissions = { path = "../core/permissions", features = ["schemas"] } [build-dependencies] vergen = "7.5.0" diff --git a/crates/quark/Cargo.toml b/crates/quark/Cargo.toml index 3efde8e6..c9fbc49c 100644 --- a/crates/quark/Cargo.toml +++ b/crates/quark/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "revolt-quark" -version = "0.6.5" +version = "0.6.6" edition = "2021" license = "AGPL-3.0-or-later" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -mongo = [ "mongodb" ] +mongo = ["mongodb"] rocket_impl = [ "rocket", "rocket_empty", @@ -18,11 +18,11 @@ rocket_impl = [ "authifier/database-mongodb", "authifier/rocket_impl", - "authifier/okapi_impl" + "authifier/okapi_impl", ] -test = [ "async-std", "mongo", "mongodb/async-std-runtime", "rocket_impl" ] -default = [ "test" ] +test = ["async-std", "mongo", "mongodb/async-std-runtime", "rocket_impl"] +default = ["test"] [dependencies] # Serialisation @@ -39,7 +39,7 @@ bson = { version = "2.1.0", features = ["chrono-0_4"] } # Spec Generation schemars = "0.8.8" revolt_okapi = "0.9.1" -revolt_rocket_okapi = { version = "0.9.1", features = [ "swagger" ] } +revolt_rocket_okapi = { version = "0.9.1", features = ["swagger"] } # Databases redis-kiss = { version = "0.1.4" } @@ -81,18 +81,20 @@ web-push = "0.7.2" # Implementations rocket_http = { optional = true, version = "0.5.0-rc.2" } -rocket = { optional = true, version = "0.5.0-rc.2", default-features = false, features = ["json"] } -rocket_empty = { version = "0.1.1", optional = true, features = [ "schema" ] } +rocket = { optional = true, version = "0.5.0-rc.2", default-features = false, features = [ + "json", +] } +rocket_empty = { version = "0.1.1", optional = true, features = ["schema"] } rocket_cors = { optional = true, git = "https://github.com/lawliet89/rocket_cors", rev = "c17e8145baa4790319fdb6a473e465b960f55e7c" } # Authifier -authifier = { version = "1.0.7", features = [ "async-std-runtime" ] } +authifier = { version = "1.0.7", features = ["async-std-runtime"] } # Sentry sentry = "0.25.0" # Core -revolt-result = { path = "../core/result", features = [ "serde", "schemas" ] } -revolt-presence = { path = "../core/presence", features = [ "redis-is-patched" ] } +revolt-result = { path = "../core/result", features = ["serde", "schemas"] } +revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] } revolt-database = { path = "../core/database" } revolt-models = { path = "../core/models" } diff --git a/crates/quark/src/util/log.rs b/crates/quark/src/util/log.rs index 04964194..fe486665 100644 --- a/crates/quark/src/util/log.rs +++ b/crates/quark/src/util/log.rs @@ -1,5 +1,5 @@ /// Configure logging and common Rust variables -pub fn setup_logging(release: &'static str) -> sentry::ClientInitGuard { +pub fn setup_logging(release: &'static str) -> Option { dotenv::dotenv().ok(); if std::env::var("RUST_LOG").is_err() { @@ -13,13 +13,17 @@ pub fn setup_logging(release: &'static str) -> sentry::ClientInitGuard { pretty_env_logger::init(); info!("Starting {release}"); - sentry::init(( - "https://d1d2a6f15c6245a987c532bbbcb30a04@glitchtip.insert.moe/2", - sentry::ClientOptions { - release: Some(release.into()), - ..Default::default() - }, - )) + if let Ok(dsn) = std::env::var("SENTRY_DSN") { + Some(sentry::init(( + dsn, + sentry::ClientOptions { + release: Some(release.into()), + ..Default::default() + }, + ))) + } else { + None + } } #[macro_export] From 430df03b20a4e1fef4e8e6253e8e84490f754dad Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Thu, 10 Aug 2023 09:42:44 +0100 Subject: [PATCH 2/5] chore: bump sentry crate --- Cargo.lock | 118 ++++++++++++++++++++++++++++++++-------- crates/quark/Cargo.toml | 2 +- 2 files changed, 95 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9a91f047..6779ea23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -421,6 +421,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + [[package]] name = "binascii" version = "0.1.4" @@ -519,7 +525,7 @@ dependencies = [ "serde", "serde_bytes", "serde_json", - "uuid", + "uuid 0.8.2", ] [[package]] @@ -798,12 +804,12 @@ dependencies = [ [[package]] name = "debugid" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ee87af31d84ef885378aebca32be3d682b0e0dc119d5b4860a2c5bb5046730" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ "serde", - "uuid", + "uuid 1.4.1", ] [[package]] @@ -1001,6 +1007,18 @@ dependencies = [ "version_check", ] +[[package]] +name = "findshlibs" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40b9e59cd0f7e0806cca4be089683ecb6434e602038df21fe6bf6711b2f07f64" +dependencies = [ + "cc", + "lazy_static", + "libc", + "winapi 0.3.9", +] + [[package]] name = "fnv" version = "1.0.7" @@ -2006,7 +2024,7 @@ dependencies = [ "trust-dns-proto", "trust-dns-resolver", "typed-builder", - "uuid", + "uuid 0.8.2", "webpki-roots", ] @@ -2232,11 +2250,12 @@ dependencies = [ [[package]] name = "os_info" -version = "3.4.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eca3ecae1481e12c3d9379ec541b238a16f0b75c9a409942daa8ec20dbfdb62" +checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" dependencies = [ "log", + "serde", "winapi 0.3.9", ] @@ -3460,39 +3479,44 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "sentry" -version = "0.25.0" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d23af89cf3e40dffb53f974e9a21653353b3e21cf51633aa58006f2a0caf8a" +checksum = "01b0ad16faa5d12372f914ed40d00bda21a6d1bdcc99264c5e5e1c9495cf3654" dependencies = [ "httpdate 1.0.2", + "native-tls", "reqwest", "sentry-backtrace", "sentry-contexts", "sentry-core", + "sentry-debug-images", "sentry-panic", + "sentry-tracing", "tokio 1.18.2", + "ureq", ] [[package]] name = "sentry-backtrace" -version = "0.25.0" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8158a446429420acdf6a4f75192ee8929da16a0c41c89a1c34b2e0f1eaebcc02" +checksum = "11f2ee8f147bb5f22ac59b5c35754a759b9a6f6722402e2a14750b2a63fc59bd" dependencies = [ "backtrace", - "lazy_static", + "once_cell", "regex", "sentry-core", ] [[package]] name = "sentry-contexts" -version = "0.25.0" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3bda8a1e3213f1944da2d42f3081ea9f3717105bb2a6b0a8fe4f5e603010a3" +checksum = "dcd133362c745151eeba0ac61e3ba8350f034e9fe7509877d08059fe1d7720c6" dependencies = [ "hostname", "libc", + "os_info", "rustc_version 0.4.0", "sentry-core", "uname", @@ -3500,11 +3524,11 @@ dependencies = [ [[package]] name = "sentry-core" -version = "0.25.0" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56333f11be3a78131c67637f7611339df8af7ad9af831226585a457df75f9e3b" +checksum = "7163491708804a74446642ff2c80b3acd668d4b9e9f497f85621f3d250fd012b" dependencies = [ - "lazy_static", + "once_cell", "rand 0.8.5", "sentry-types", "serde", @@ -3512,20 +3536,43 @@ dependencies = [ ] [[package]] -name = "sentry-panic" -version = "0.25.0" +name = "sentry-debug-images" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b957b1965c450acd220a27806fe1f2dec998d393973ebae797936b12df1c7416" +checksum = "6a5003d7ff08aa3b2b76994080b183e8cfa06c083e280737c9cee02ca1c70f5e" +dependencies = [ + "findshlibs", + "once_cell", + "sentry-core", +] + +[[package]] +name = "sentry-panic" +version = "0.31.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4dfe8371c9b2e126a8b64f6fefa54cef716ff2a50e63b5558a48b899265bccd" dependencies = [ "sentry-backtrace", "sentry-core", ] [[package]] -name = "sentry-types" -version = "0.25.0" +name = "sentry-tracing" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "825fd3382e2397007499a910e0184e55f7837cb0df4af30ae62bd2123e2ebcd6" +checksum = "5aca8b88978677a27ee1a91beafe4052306c474c06f582321fde72d2e2cc2f7f" +dependencies = [ + "sentry-backtrace", + "sentry-core", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sentry-types" +version = "0.31.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e7a88e0c1922d19b3efee12a8215f6a8a806e442e665ada71cc222cab72985f" dependencies = [ "debugid", "getrandom", @@ -3535,7 +3582,7 @@ dependencies = [ "thiserror", "time 0.3.17", "url", - "uuid", + "uuid 1.4.1", ] [[package]] @@ -4407,6 +4454,19 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "ureq" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" +dependencies = [ + "base64 0.21.2", + "log", + "native-tls", + "once_cell", + "url", +] + [[package]] name = "url" version = "2.2.2" @@ -4436,6 +4496,16 @@ dependencies = [ "serde", ] +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom", + "serde", +] + [[package]] name = "validator" version = "0.15.0" diff --git a/crates/quark/Cargo.toml b/crates/quark/Cargo.toml index c9fbc49c..9d6260b9 100644 --- a/crates/quark/Cargo.toml +++ b/crates/quark/Cargo.toml @@ -91,7 +91,7 @@ rocket_cors = { optional = true, git = "https://github.com/lawliet89/rocket_cors authifier = { version = "1.0.7", features = ["async-std-runtime"] } # Sentry -sentry = "0.25.0" +sentry = "0.31.5" # Core revolt-result = { path = "../core/result", features = ["serde", "schemas"] } From bfdd713d384a38480404f58942e316aaed5f696d Mon Sep 17 00:00:00 2001 From: Lea Date: Thu, 6 Jul 2023 20:58:49 +0200 Subject: [PATCH 3/5] fix: allow fetching mutuals for bots --- crates/delta/src/routes/users/find_mutual.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/crates/delta/src/routes/users/find_mutual.rs b/crates/delta/src/routes/users/find_mutual.rs index 0d2bac7c..7e5bfaac 100644 --- a/crates/delta/src/routes/users/find_mutual.rs +++ b/crates/delta/src/routes/users/find_mutual.rs @@ -24,10 +24,6 @@ pub async fn req(db: &State, user: User, target: Ref) -> Result Date: Thu, 10 Aug 2023 21:04:31 +0100 Subject: [PATCH 4/5] chore: Log errors from failed pub/sub messages --- Cargo.toml | 2 +- crates/bonfire/Cargo.toml | 1 + crates/bonfire/src/websocket.rs | 13 +++++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a5a13117..01c3fed3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,4 @@ members = ["crates/delta", "crates/bonfire", "crates/quark", "crates/core/*"] [patch.crates-io] # mobc-redis = { git = "https://github.com/insertish/mobc", rev = "8b880bb59f2ba80b4c7bc40c649c113d8857a186" } -redis = { git = "https://github.com/insertish/redis-rs", rev = "1a41faf356fd21aebba71cea7eb7eb2653e5f0ef" } +redis = { git = "https://github.com/revoltchat/redis-rs", rev = "cfd75cdebebf55f646697a933981741e74949c89" } diff --git a/crates/bonfire/Cargo.toml b/crates/bonfire/Cargo.toml index f787b979..797d193a 100644 --- a/crates/bonfire/Cargo.toml +++ b/crates/bonfire/Cargo.toml @@ -33,3 +33,4 @@ async-std = { version = "1.8.0", features = [ # core revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] } +sentry = "0.31.5" diff --git a/crates/bonfire/src/websocket.rs b/crates/bonfire/src/websocket.rs index c2bbead6..b0cb8f45 100644 --- a/crates/bonfire/src/websocket.rs +++ b/crates/bonfire/src/websocket.rs @@ -136,13 +136,13 @@ pub fn spawn_client(db: &'static Database, stream: TcpStream, addr: SocketAddr) );*/ // Handle incoming events. - match conn.on_message().next().await.map(|item| { - ( + match conn.on_message().next().await.map(|res| { + res.map(|item|( item.get_channel_name().to_string(), redis_kiss::decode_payload::(&item), - ) + )) }) { - Some((channel, item)) => { + Some(Ok((channel, item))) => { if let Ok(mut event) = item { if state .handle_incoming_event_v1( @@ -160,6 +160,11 @@ pub fn spawn_client(db: &'static Database, stream: TcpStream, addr: SocketAddr) warn!("Failed to deserialise an event for {channel}!"); } } + Some(Err(e)) => { + info!("Error while consuming pub/sub messages: {e:?}"); + sentry::capture_error(&e); + break + } // No more data, assume we disconnected or otherwise // something bad occurred, so disconnect user. None => break, From 431046cb4cf09757f25371e64cc774df94520bee Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 26 Aug 2023 13:33:05 +0100 Subject: [PATCH 5/5] chore: cut new release with redis patches and debug profile --- Cargo.lock | 26 +++++++++++++------------- Cargo.toml | 6 +++++- crates/bonfire/Cargo.toml | 2 +- crates/core/database/Cargo.toml | 10 +++++----- crates/core/models/Cargo.toml | 4 ++-- crates/core/permissions/Cargo.toml | 2 +- crates/core/presence/Cargo.toml | 2 +- crates/core/result/Cargo.toml | 2 +- crates/delta/Cargo.toml | 2 +- crates/quark/Cargo.toml | 2 +- 10 files changed, 31 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6779ea23..29810124 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2712,7 +2712,7 @@ dependencies = [ [[package]] name = "redis" version = "0.22.3" -source = "git+https://github.com/insertish/redis-rs?rev=1a41faf356fd21aebba71cea7eb7eb2653e5f0ef#1a41faf356fd21aebba71cea7eb7eb2653e5f0ef" +source = "git+https://github.com/revoltchat/redis-rs?rev=1a41faf356fd21aebba71cea7eb7eb2653e5f0ef#1a41faf356fd21aebba71cea7eb7eb2653e5f0ef" dependencies = [ "async-std", "async-trait", @@ -2731,9 +2731,8 @@ dependencies = [ [[package]] name = "redis" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea8c51b5dc1d8e5fd3350ec8167f464ec0995e79f2e90a075b63371500d557f" +version = "0.23.1" +source = "git+https://github.com/revoltchat/redis-rs?rev=f8ca28ab85da59d2ccde526b4d2fb390eff5a5f9#f8ca28ab85da59d2ccde526b4d2fb390eff5a5f9" dependencies = [ "async-std", "async-trait", @@ -2759,7 +2758,7 @@ dependencies = [ "lazy_static", "mobc", "mobc-redis", - "redis 0.23.0", + "redis 0.23.1", "rmp-serde", "serde", "serde_json", @@ -2877,7 +2876,7 @@ dependencies = [ [[package]] name = "revolt-bonfire" -version = "0.6.6" +version = "0.6.7" dependencies = [ "async-std", "async-tungstenite", @@ -2888,13 +2887,14 @@ dependencies = [ "revolt-presence", "revolt-quark", "rmp-serde", + "sentry", "serde", "serde_json", ] [[package]] name = "revolt-database" -version = "0.6.6" +version = "0.6.7" dependencies = [ "async-recursion", "async-std", @@ -2926,7 +2926,7 @@ dependencies = [ [[package]] name = "revolt-delta" -version = "0.6.6" +version = "0.6.7" dependencies = [ "async-channel", "async-std", @@ -2967,7 +2967,7 @@ dependencies = [ [[package]] name = "revolt-models" -version = "0.6.6" +version = "0.6.7" dependencies = [ "indexmap", "iso8601-timestamp 0.2.11", @@ -2980,7 +2980,7 @@ dependencies = [ [[package]] name = "revolt-permissions" -version = "0.6.6" +version = "0.6.7" dependencies = [ "async-std", "async-trait", @@ -2994,7 +2994,7 @@ dependencies = [ [[package]] name = "revolt-presence" -version = "0.6.6" +version = "0.6.7" dependencies = [ "async-std", "log", @@ -3005,7 +3005,7 @@ dependencies = [ [[package]] name = "revolt-quark" -version = "0.6.6" +version = "0.6.7" dependencies = [ "async-lock", "async-recursion", @@ -3058,7 +3058,7 @@ dependencies = [ [[package]] name = "revolt-result" -version = "0.6.6" +version = "0.6.7" dependencies = [ "revolt_okapi", "revolt_rocket_okapi", diff --git a/Cargo.toml b/Cargo.toml index 01c3fed3..36f24bb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,8 @@ members = ["crates/delta", "crates/bonfire", "crates/quark", "crates/core/*"] [patch.crates-io] # mobc-redis = { git = "https://github.com/insertish/mobc", rev = "8b880bb59f2ba80b4c7bc40c649c113d8857a186" } -redis = { git = "https://github.com/revoltchat/redis-rs", rev = "cfd75cdebebf55f646697a933981741e74949c89" } +redis22 = { package = "redis", version = "0.22.3", git = "https://github.com/revoltchat/redis-rs", rev = "1a41faf356fd21aebba71cea7eb7eb2653e5f0ef" } +redis23 = { package = "redis", version = "0.23.1", git = "https://github.com/revoltchat/redis-rs", rev = "f8ca28ab85da59d2ccde526b4d2fb390eff5a5f9" } + +[profile.release] +debug = true diff --git a/crates/bonfire/Cargo.toml b/crates/bonfire/Cargo.toml index 797d193a..338dd7a7 100644 --- a/crates/bonfire/Cargo.toml +++ b/crates/bonfire/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-bonfire" -version = "0.6.6" +version = "0.6.7" license = "AGPL-3.0-or-later" edition = "2021" diff --git a/crates/core/database/Cargo.toml b/crates/core/database/Cargo.toml index 0546d1bb..ea27b17e 100644 --- a/crates/core/database/Cargo.toml +++ b/crates/core/database/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-database" -version = "0.6.6" +version = "0.6.7" edition = "2021" license = "AGPL-3.0-or-later" authors = ["Paul Makles "] @@ -22,10 +22,10 @@ default = ["mongodb", "async-std-runtime"] [dependencies] # Core -revolt-result = { version = "0.6.6", path = "../result" } -revolt-models = { version = "0.6.6", path = "../models" } -revolt-presence = { version = "0.6.6", path = "../presence" } -revolt-permissions = { version = "0.6.6", path = "../permissions", features = [ +revolt-result = { version = "0.6.7", path = "../result" } +revolt-models = { version = "0.6.7", path = "../models" } +revolt-presence = { version = "0.6.7", path = "../presence" } +revolt-permissions = { version = "0.6.7", path = "../permissions", features = [ "serde", "bson", ] } diff --git a/crates/core/models/Cargo.toml b/crates/core/models/Cargo.toml index 113e29bb..f45371fd 100644 --- a/crates/core/models/Cargo.toml +++ b/crates/core/models/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-models" -version = "0.6.6" +version = "0.6.7" edition = "2021" license = "AGPL-3.0-or-later" authors = ["Paul Makles "] @@ -18,7 +18,7 @@ default = ["serde", "partials"] [dependencies] # Core -revolt-permissions = { version = "0.6.6", path = "../permissions" } +revolt-permissions = { version = "0.6.7", path = "../permissions" } # Serialisation indexmap = "1.9.3" diff --git a/crates/core/permissions/Cargo.toml b/crates/core/permissions/Cargo.toml index 4fa89fed..bf31e74c 100644 --- a/crates/core/permissions/Cargo.toml +++ b/crates/core/permissions/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-permissions" -version = "0.6.6" +version = "0.6.7" edition = "2021" license = "AGPL-3.0-or-later" authors = ["Paul Makles "] diff --git a/crates/core/presence/Cargo.toml b/crates/core/presence/Cargo.toml index 67bc9f05..b2f7bb54 100644 --- a/crates/core/presence/Cargo.toml +++ b/crates/core/presence/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-presence" -version = "0.6.6" +version = "0.6.7" edition = "2021" license = "AGPL-3.0-or-later" authors = ["Paul Makles "] diff --git a/crates/core/result/Cargo.toml b/crates/core/result/Cargo.toml index 9907aad3..b1140982 100644 --- a/crates/core/result/Cargo.toml +++ b/crates/core/result/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-result" -version = "0.6.6" +version = "0.6.7" edition = "2021" license = "AGPL-3.0-or-later" authors = ["Paul Makles "] diff --git a/crates/delta/Cargo.toml b/crates/delta/Cargo.toml index e7466efa..d4e663f6 100644 --- a/crates/delta/Cargo.toml +++ b/crates/delta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-delta" -version = "0.6.6" +version = "0.6.7" license = "AGPL-3.0-or-later" authors = ["Paul Makles "] edition = "2018" diff --git a/crates/quark/Cargo.toml b/crates/quark/Cargo.toml index 9d6260b9..1cb60cb6 100644 --- a/crates/quark/Cargo.toml +++ b/crates/quark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "revolt-quark" -version = "0.6.6" +version = "0.6.7" edition = "2021" license = "AGPL-3.0-or-later"