Skip to content

Commit

Permalink
chore: bump deps
Browse files Browse the repository at this point in the history
Not sure what to do in wait_for_event() in test.rs when the item returns a RedisError. For now opted to just unwrap() since this is a test.

jxl_oxide has deprecated Render::image() in favour of Render::stream()

Comment out unused redis22

In Rocket, Outcome::Failure has become Outcome::Error

to_rfc3339_string() is deprecated in favour of it's equivalent: try_to_rfc3339_string().unwrap()
This should be ok because we are calling this method on DateTime::now()

Signed-off-by: Pi-Cla <pirateclip@protonmail.com>
  • Loading branch information
Pi-Cla committed Nov 19, 2024
1 parent b9ae333 commit a401201
Show file tree
Hide file tree
Showing 25 changed files with 2,473 additions and 2,112 deletions.
4,383 changes: 2,366 additions & 2,017 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = [

[patch.crates-io]
# mobc-redis = { git = "https://github.com/insertish/mobc", rev = "8b880bb59f2ba80b4c7bc40c649c113d8857a186" }
redis22 = { package = "redis", version = "0.22.3", git = "https://github.com/revoltchat/redis-rs", rev = "1a41faf356fd21aebba71cea7eb7eb2653e5f0ef" }
# 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" }
# authifier = { package = "authifier", version = "1.0.8", path = "../authifier/crates/authifier" }
# rocket_authifier = { package = "rocket_authifier", version = "1.0.8", path = "../authifier/crates/rocket_authifier" }
10 changes: 5 additions & 5 deletions crates/bonfire/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ edition = "2021"
[dependencies]
# util
log = "*"
sentry = "0.31.5"
lru = "0.7.6"
ulid = "0.5.0"
sentry = "0.34"
lru = "0.12"
ulid = "1"
once_cell = "1.9.0"
redis-kiss = "0.1.4"
lru_time_cache = "0.11.11"
Expand All @@ -28,7 +28,7 @@ serde = "1.0.136"

# async
futures = "0.3.21"
async-tungstenite = { version = "0.17.0", features = ["async-std-runtime"] }
async-tungstenite = { version = "0.28", features = ["async-std-runtime"] }
async-std = { version = "1.8.0", features = [
"tokio1",
"tokio02",
Expand All @@ -45,4 +45,4 @@ revolt-permissions = { version = "0.7.19", path = "../core/permissions" }
revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] }

# redis
fred = { version = "8.0.1", features = ["subscriber-client"] }
fred = { version = "9", features = ["subscriber-client"] }
3 changes: 2 additions & 1 deletion crates/bonfire/src/events/state.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{
collections::{HashMap, HashSet},
num::NonZero,
sync::Arc,
time::Duration,
};
Expand Down Expand Up @@ -57,7 +58,7 @@ impl Default for Cache {
members: Default::default(),
servers: Default::default(),

seen_events: LruCache::new(20),
seen_events: LruCache::new(NonZero::new(20).unwrap()),
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions crates/core/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ default = ["test"]

[dependencies]
# Utility
dotenv = "0.15.0"
config = "0.13.3"
cached = "0.44.0"
dotenvy = "0.15"
config = "0.14"
cached = { version = "0.54", features = ["async"] }
once_cell = "1.18.0"

# Serde
Expand All @@ -29,10 +29,10 @@ async-std = { version = "1.8.0", features = ["attributes"], optional = true }

# Logging
log = "0.4.14"
pretty_env_logger = "0.4.0"
pretty_env_logger = "0.5"

# Sentry
sentry = "0.31.5"
sentry = "0.34"

# Core
revolt-result = { version = "0.7.19", path = "../result", optional = true }
2 changes: 1 addition & 1 deletion crates/core/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ pub async fn config() -> Settings {

/// Configure logging and common Rust variables
pub async fn setup_logging(release: &'static str, dsn: String) -> Option<sentry::ClientInitGuard> {
dotenv::dotenv().ok();
dotenvy::dotenv().ok();

if std::env::var("RUST_LOG").is_err() {
std::env::set_var("RUST_LOG", "info");
Expand Down
16 changes: 8 additions & 8 deletions crates/core/database/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ revolt-permissions = { version = "0.7.19", path = "../permissions", features = [

# Utility
log = "0.4"
lru = "0.11.0"
lru = "0.12"
rand = "0.8.5"
ulid = "1.0.0"
nanoid = "0.4.0"
base64 = "0.21.3"
base64 = "0.22.1"
once_cell = "1.17"
indexmap = "1.9.1"
decancer = "1.6.2"
decancer = "3"
deadqueue = "0.2.4"
linkify = { optional = true, version = "0.8.1" }
linkify = { optional = true, version = "0.10" }
url-escape = { optional = true, version = "0.1.1" }
validator = { version = "0.16", features = ["derive"] }
isahc = { optional = true, version = "1.7", features = ["json"] }
Expand All @@ -57,7 +57,7 @@ isahc = { optional = true, version = "1.7", features = ["json"] }
serde_json = "1"
revolt_optional_struct = "0.2.0"
serde = { version = "1", features = ["derive"] }
iso8601-timestamp = { version = "0.2.10", features = ["serde", "bson"] }
iso8601-timestamp = { version = "0.3", features = ["serde", "bson"] }

# Events
redis-kiss = { version = "0.1.4" }
Expand All @@ -72,7 +72,7 @@ regex = "1"

# Async Language Features
futures = "0.3.19"
async-lock = "2.8.0"
async-lock = "3"
async-trait = "0.1.51"
async-recursion = "1.0.4"

Expand All @@ -84,11 +84,11 @@ axum = { version = "0.7.5", optional = true }

# Rocket Impl
schemars = { version = "0.8.8", optional = true }
rocket = { version = "0.5.0-rc.2", default-features = false, features = [
rocket = { version = "0.5.1", default-features = false, features = [
"json",
], optional = true }
revolt_okapi = { version = "0.9.1", optional = true }
revolt_rocket_okapi = { version = "0.9.1", optional = true }
revolt_rocket_okapi = { version = "0.10", optional = true }

# Notifications
fcm_v1 = "0.3.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
doc! {},
doc! {
"$set": {
"joined_at": DateTime::now().to_rfc3339_string()
"joined_at": DateTime::now().try_to_rfc3339_string().unwrap()
}
},
None,
Expand Down
4 changes: 3 additions & 1 deletion crates/core/database/src/models/users/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ impl User {
let username_lowercase = username.to_lowercase();

// Block homoglyphs
if decancer::cure(&username_lowercase).into_str() != username_lowercase {
if decancer::cure!(&username_lowercase).map_err(|_| create_error!(InvalidUsername))?
!= username_lowercase
{
return Err(create_error!(InvalidUsername));
}

Expand Down
2 changes: 1 addition & 1 deletion crates/core/database/src/models/users/rocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl<'r> FromRequest<'r> for User {
if let Some(user) = user {
Outcome::Success(user.clone())
} else {
Outcome::Failure((Status::Unauthorized, authifier::Error::InvalidSession))
Outcome::Error((Status::Unauthorized, authifier::Error::InvalidSession))
}
}
}
4 changes: 2 additions & 2 deletions crates/core/database/src/util/idempotency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl<'r> FromRequest<'r> for IdempotencyKey {
.map(|k| k.to_string())
{
if key.len() > 64 {
return Outcome::Failure((
return Outcome::Error((
Status::BadRequest,
create_error!(FailedValidation {
error: "idempotency key too long".to_string(),
Expand All @@ -113,7 +113,7 @@ impl<'r> FromRequest<'r> for IdempotencyKey {
let idempotency = IdempotencyKey { key };
let mut cache = TOKEN_CACHE.lock().await;
if cache.get(&idempotency.key).is_some() {
return Outcome::Failure((Status::Conflict, create_error!(DuplicateNonce)));
return Outcome::Error((Status::Conflict, create_error!(DuplicateNonce)));
}

cache.put(idempotency.key.clone(), ());
Expand Down
2 changes: 1 addition & 1 deletion crates/core/files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ revolt-config = { version = "0.7.19", path = "../config", features = [
revolt-result = { version = "0.7.19", path = "../result" }

# image processing
jxl-oxide = "0.8.1"
jxl-oxide = "0.10"
image = { version = "0.25.2" }

# svg rendering
Expand Down
40 changes: 20 additions & 20 deletions crates/core/files/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,28 +172,28 @@ pub fn decode_image<R: Read + BufRead + Seek>(reader: &mut R, mime: &str) -> Res
let jxl_image = report_internal_error!(jxl_oxide::JxlImage::builder().read(reader))?;
if let Ok(frame) = jxl_image.render_frame(0) {
match frame.color_channels().len() {
3 => Ok(DynamicImage::ImageRgb8(
DynamicImage::ImageRgb32F(
ImageBuffer::from_vec(
jxl_image.width(),
jxl_image.height(),
frame.image().buf().to_vec(),
3 => {
let mut buf: Vec<f32> = Vec::new();
frame.stream().write_to_buffer(&mut buf);
Ok(DynamicImage::ImageRgb8(
DynamicImage::ImageRgb32F(
ImageBuffer::from_vec(jxl_image.width(), jxl_image.height(), buf)
.ok_or_else(|| create_error!(ImageProcessingFailed))?,
)
.ok_or_else(|| create_error!(ImageProcessingFailed))?,
)
.to_rgb8(),
)),
4 => Ok(DynamicImage::ImageRgba8(
DynamicImage::ImageRgba32F(
ImageBuffer::from_vec(
jxl_image.width(),
jxl_image.height(),
frame.image().buf().to_vec(),
.to_rgb8(),
))
}
4 => {
let mut buf: Vec<f32> = Vec::new();
frame.stream().write_to_buffer(&mut buf);
Ok(DynamicImage::ImageRgba8(
DynamicImage::ImageRgba32F(
ImageBuffer::from_vec(jxl_image.width(), jxl_image.height(), buf)
.ok_or_else(|| create_error!(ImageProcessingFailed))?,
)
.ok_or_else(|| create_error!(ImageProcessingFailed))?,
)
.to_rgba8(),
)),
.to_rgba8(),
))
}
_ => Err(create_error!(ImageProcessingFailed)),
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions crates/core/models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ indexmap = "1.9.3"
once_cell = "1.17.1"

# Rocket
rocket = { optional = true, version = "0.5.0-rc.2", default-features = false }
rocket = { optional = true, version = "0.5.1", default-features = false }

# Serialisation
revolt_optional_struct = { version = "0.2.0", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
iso8601-timestamp = { version = "0.2.11", features = ["schema", "bson"] }
iso8601-timestamp = { version = "0.3", features = ["schema", "bson"] }

# Spec Generation
schemars = { version = "0.8.8", optional = true, features = ["indexmap1"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/core/permissions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ revolt-result = { version = "0.7.19", path = "../result" }
# Utility
auto_ops = "0.3.0"
once_cell = "1.17"
num_enum = { version = "0.6.1", optional = true }
num_enum = { version = "0.7", optional = true }

# Async
async-trait = "0.1.51"
Expand Down
4 changes: 2 additions & 2 deletions crates/core/result/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ schemars = { version = "0.8.8", optional = true }
utoipa = { version = "4.2.3", optional = true }

# Rocket
rocket = { optional = true, version = "0.5.0-rc.2", default-features = false }
revolt_rocket_okapi = { version = "0.9.1", optional = true }
rocket = { optional = true, version = "0.5.1", default-features = false }
revolt_rocket_okapi = { version = "0.10", optional = true }
revolt_okapi = { version = "0.9.1", optional = true }

# Axum
Expand Down
36 changes: 17 additions & 19 deletions crates/delta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,57 +13,54 @@ rand = "0.8.5"
redis-kiss = "0.1.4"

# Utility
lru = "0.7.0"
lru = "0.12"
url = "2.2.2"
log = "0.4.11"
dotenv = "0.15.0"
dashmap = "5.2.0"
linkify = "0.6.0"
dotenvy = "0.15"
dashmap = "6"
linkify = "0.10"
once_cell = "1.17.1"
env_logger = "0.7.1"
env_logger = "0.11"

# Lang. Utilities
regex = "1"
num_enum = "0.5.1"
num_enum = "0.7"
impl_ops = "0.1.1"
bitfield = "0.13.2"
bitfield = "0.17"

# ID / key generation
ulid = "0.4.1"
ulid = "1"
nanoid = "0.4.0"

# serde
serde_json = "1.0.57"
serde = { version = "1.0.115", features = ["derive"] }
validator = { version = "0.16", features = ["derive"] }
iso8601-timestamp = { version = "0.2.11", features = [] }
iso8601-timestamp = { version = "0.3", features = [] }

# async
futures = "0.3.8"
chrono = "0.4.15"
async-channel = "1.6.1"
reqwest = { version = "0.11.4", features = ["json"] }
async-channel = "2.3.1"
reqwest = { version = "0.12", features = ["json"] }
async-std = { version = "1.8.0", features = [
"tokio1",
"tokio02",
"attributes",
] }

# internal util
lettre = "0.10.0-alpha.4"
lettre = "0.11"

# web
rocket = { version = "0.5.0-rc.2", default-features = false, features = [
"json",
] }
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", rev = "c17e8145baa4790319fdb6a473e465b960f55e7c" }
rocket = { version = "0.5.1", default-features = false, features = ["json"] }
rocket_cors = "0.6"
rocket_empty = { version = "0.1.1", features = ["schema"] }
rocket_authifier = { version = "1.0.8" }
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.10", features = ["swagger"] }

# core
authifier = "1.0.8"
Expand All @@ -82,4 +79,5 @@ revolt-result = { path = "../core/result", features = ["rocket", "okapi"] }
revolt-permissions = { path = "../core/permissions", features = ["schemas"] }

[build-dependencies]
vergen = "7.5.0"
vergen = "9"
# internal util
4 changes: 2 additions & 2 deletions crates/delta/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use vergen::{vergen, Config};
use vergen::Emitter;

use std::process::Command;

Expand All @@ -12,5 +12,5 @@ fn main() {
}
}

vergen(Config::default()).ok();
let _ = Emitter::default().emit();
}
Loading

0 comments on commit a401201

Please sign in to comment.