Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 20 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions bin/alisa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ transport = { path = "../../lib/transport" }
pretty_env_logger = "0.5"
log = "0.4"

bytes = "1"
url = "2.5"

axum = "0.8"
chipp_http = "1.2"

tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util", "net", "time", "signal"] }
futures = "0.3"
tokio = { version = "1", features = ["macros", "rt-multi-thread", "net", "time", "signal"] }
futures-util = "0.3"

jsonwebtoken = "9.3"
Expand Down
6 changes: 1 addition & 5 deletions bin/elisa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ transport = { path = "../../lib/transport" }

futures-util = "0.3"

tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util", "net", "time", "sync"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time", "sync"] }
paho-mqtt = "0.13.2"

pretty_env_logger = "0.5"
log = "0.4"

md5 = "0.7.0"

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio-stream = "0.1.17"
3 changes: 1 addition & 2 deletions bin/elisheba/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sonoff = { path = "../../lib/sonoff" }
transport = { path = "../../lib/transport" }

futures-util = "0.3"
tokio = { version = "1", features = ["macros", "rt-multi-thread", "net", "signal", "sync"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time"] }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Removing the signal feature from tokio is problematic as it breaks the graceful shutdown functionality in src/main.rs. Please re-add the signal feature. It's also advisable to keep the net and sync features for a networked, multi-threaded application like this to avoid potential issues.

Suggested change
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time", "net", "signal", "sync"] }


paho-mqtt = "0.13.2"

Expand All @@ -20,5 +20,4 @@ log = "0.4"

md5 = "*"

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
9 changes: 1 addition & 8 deletions bin/elisheba/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use transport::{connect_mqtt, Topic};
use futures_util::StreamExt;
use log::{error, info, trace};
use paho_mqtt::{AsyncClient as MqClient, MessageBuilder, QOS_1};
use tokio::signal::unix::{signal, SignalKind};
use tokio::{task, time};

const VERSION: &str = env!("CARGO_PKG_VERSION");
Expand Down Expand Up @@ -43,13 +42,7 @@ async fn main() -> Result<()> {
let set_handle = task::spawn(subscribe_action(mqtt_client.clone(), client.clone()));
let state_handle = task::spawn(subscribe_state(mqtt_client, storage, client));

tokio::select! {
_ = try_join(set_handle, state_handle) => {},
_ = tokio::spawn(async move {
let mut sig = signal(SignalKind::terminate()).unwrap();
sig.recv().await
}) => { info!("got SIGTERM, exiting...") },
};
try_join(set_handle, state_handle).await?;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The graceful shutdown logic has been removed. As try_join will block indefinitely, the process can no longer be stopped gracefully via SIGTERM. This is a critical regression. After restoring the signal feature in Cargo.toml, please re-implement the graceful shutdown mechanism here, for example by replacing this line with a tokio::select! block that waits for either the tasks to complete or for a shutdown signal.


Ok(())
}
Expand Down
4 changes: 1 addition & 3 deletions bin/elizabeth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ transport = { path = "../../lib/transport" }

futures-util = "0.3"

tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util", "net", "time", "sync", "signal"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time", "sync", "signal"] }
paho-mqtt = "0.13.2"

pretty_env_logger = "0.5"
log = "0.4"

md5 = "0.7.0"

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio-stream = "0.1.17"
7 changes: 1 addition & 6 deletions bin/isabel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@ edition = "2021"
bluetooth = { path = "../../lib/bluetooth" }
transport = { path = "../../lib/transport" }

futures-util = "0.3"

tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util", "net", "time"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time"] }
paho-mqtt = "0.13.2"

pretty_env_logger = "0.5"
log = "0.4"

md5 = "0.7.0"

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

rusqlite = "0.34"
2 changes: 1 addition & 1 deletion lib/bluetooth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
log = "0.4"
tokio = { version = "1", features = ["io-util", "sync"] }
tokio = { version = "1", features = ["sync"] }
enumflags2 = "0.7"
nix = { version = "0.29.0", features = ["ioctl"] }

Expand Down
4 changes: 2 additions & 2 deletions lib/inspinia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
log = "0.4"

tokio-tungstenite = { version = "0.26.2", features = ["native-tls"] }
tokio = { version = "1", features = ["fs", "net", "sync"] }
tokio = { version = "1", features = ["fs", "io-util", "net", "sync"] }
futures-util = "0.3"

chipp_http = "1.2"
Expand All @@ -22,4 +22,4 @@ serde_json = "1.0"
chrono = { version = "0.4", features = ["std", "clock"], default-features = false }
chrono-humanize = "0.2"

zip = { version = "2.6", default-features = false, features = ["deflate"] }
zip = { version = "3.0", default-features = false, features = ["deflate"] }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The zip crate has been upgraded from version 2.6 to 3.0. This is a major version bump, which often indicates breaking changes. According to the zip crate's changelog, version 3.0 is a rewrite with a focus on streaming support. Please ensure that this upgrade has been thoroughly tested to confirm there are no regressions or unexpected behavior.

6 changes: 1 addition & 5 deletions lib/sonoff/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ crypto = { path = "../crypto" }

log = "0.4"
futures-util = { version = "0.3.31", features = ["sink"] }
tokio-util = { version = "0.7.14", features = ["full", "codec"] }
tokio-util = { version = "0.7.14", features = ["codec", "net"] }

base64 = "0.22"
chipp_http = "1.2"
Expand All @@ -22,10 +22,6 @@ serde_json = "1.0"
[dependencies.tokio]
version = "1.44"
features = [
"io-util",
"macros",
"net",
"rt-multi-thread",
"sync",
"time",
]