From 92514cca47bdc361257b623f6369ecf826e3ef4f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 12:22:22 +0200 Subject: [PATCH] fix(deps): update rust crate tokio-tungstenite to 0.20 (#513) * fix(deps): update rust crate tokio-tungstenite to 0.20 * adapt new websocket config struct --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FabianLars --- Cargo.lock | 8 ++++---- plugins/authenticator/tsconfig.json | 5 ++++- plugins/autostart/tsconfig.json | 5 ++++- plugins/fs-extra/tsconfig.json | 5 ++++- plugins/fs-watch/tsconfig.json | 5 ++++- plugins/log/tsconfig.json | 5 ++++- plugins/positioner/tsconfig.json | 5 ++++- plugins/sql/tsconfig.json | 5 ++++- plugins/store/tsconfig.json | 5 ++++- plugins/stronghold/tsconfig.json | 5 ++++- plugins/upload/tsconfig.json | 5 ++++- plugins/websocket/Cargo.toml | 2 +- .../examples/svelte-app/src-tauri/Cargo.lock | 8 ++++---- .../examples/svelte-app/src-tauri/Cargo.toml | 2 +- plugins/websocket/src/lib.rs | 11 +++++++++-- plugins/websocket/tsconfig.json | 5 ++++- plugins/window-state/tsconfig.json | 5 ++++- shared/template/tsconfig.json | 5 ++++- 18 files changed, 71 insertions(+), 25 deletions(-) mode change 120000 => 100644 plugins/authenticator/tsconfig.json mode change 120000 => 100644 plugins/autostart/tsconfig.json mode change 120000 => 100644 plugins/fs-extra/tsconfig.json mode change 120000 => 100644 plugins/fs-watch/tsconfig.json mode change 120000 => 100644 plugins/log/tsconfig.json mode change 120000 => 100644 plugins/positioner/tsconfig.json mode change 120000 => 100644 plugins/sql/tsconfig.json mode change 120000 => 100644 plugins/store/tsconfig.json mode change 120000 => 100644 plugins/stronghold/tsconfig.json mode change 120000 => 100644 plugins/upload/tsconfig.json mode change 120000 => 100644 plugins/websocket/tsconfig.json mode change 120000 => 100644 plugins/window-state/tsconfig.json mode change 120000 => 100644 shared/template/tsconfig.json diff --git a/Cargo.lock b/Cargo.lock index 643a7437..08b8c9ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4894,9 +4894,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec509ac96e9a0c43427c74f003127d953a265737636129424288d27cb5c4b12c" +checksum = "2b2dbec703c26b00d74844519606ef15d09a7d6857860f84ad223dec002ddea2" dependencies = [ "futures-util", "log", @@ -5032,9 +5032,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15fba1a6d6bb030745759a9a2a588bfe8490fc8b4751a277db3a0be1c9ebbf67" +checksum = "e862a1c4128df0112ab625f55cd5c934bcb4312ba80b39ae4b4835a3fd58e649" dependencies = [ "byteorder", "bytes 1.4.0", diff --git a/plugins/authenticator/tsconfig.json b/plugins/authenticator/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/authenticator/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/authenticator/tsconfig.json b/plugins/authenticator/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/authenticator/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/autostart/tsconfig.json b/plugins/autostart/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/autostart/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/autostart/tsconfig.json b/plugins/autostart/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/autostart/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/fs-extra/tsconfig.json b/plugins/fs-extra/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/fs-extra/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/fs-extra/tsconfig.json b/plugins/fs-extra/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/fs-extra/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/fs-watch/tsconfig.json b/plugins/fs-watch/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/fs-watch/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/fs-watch/tsconfig.json b/plugins/fs-watch/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/fs-watch/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/log/tsconfig.json b/plugins/log/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/log/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/log/tsconfig.json b/plugins/log/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/log/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/positioner/tsconfig.json b/plugins/positioner/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/positioner/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/positioner/tsconfig.json b/plugins/positioner/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/positioner/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/sql/tsconfig.json b/plugins/sql/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/sql/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/sql/tsconfig.json b/plugins/sql/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/sql/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/store/tsconfig.json b/plugins/store/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/store/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/store/tsconfig.json b/plugins/store/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/store/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/stronghold/tsconfig.json b/plugins/stronghold/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/stronghold/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/stronghold/tsconfig.json b/plugins/stronghold/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/stronghold/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/upload/tsconfig.json b/plugins/upload/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/upload/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/upload/tsconfig.json b/plugins/upload/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/upload/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/websocket/Cargo.toml b/plugins/websocket/Cargo.toml index 64bea6d7..ec5091a3 100644 --- a/plugins/websocket/Cargo.toml +++ b/plugins/websocket/Cargo.toml @@ -18,4 +18,4 @@ thiserror.workspace = true rand = "0.8" futures-util = "0.3" tokio = { version = "1", features = ["net", "sync"] } -tokio-tungstenite = { version = "0.19", features = ["native-tls"] } +tokio-tungstenite = { version = "0.20", features = ["native-tls"] } diff --git a/plugins/websocket/examples/svelte-app/src-tauri/Cargo.lock b/plugins/websocket/examples/svelte-app/src-tauri/Cargo.lock index d0e8a01c..49a851a7 100644 --- a/plugins/websocket/examples/svelte-app/src-tauri/Cargo.lock +++ b/plugins/websocket/examples/svelte-app/src-tauri/Cargo.lock @@ -2774,9 +2774,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec509ac96e9a0c43427c74f003127d953a265737636129424288d27cb5c4b12c" +checksum = "2b2dbec703c26b00d74844519606ef15d09a7d6857860f84ad223dec002ddea2" dependencies = [ "futures-util", "log", @@ -2806,9 +2806,9 @@ dependencies = [ [[package]] name = "tungstenite" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15fba1a6d6bb030745759a9a2a588bfe8490fc8b4751a277db3a0be1c9ebbf67" +checksum = "e862a1c4128df0112ab625f55cd5c934bcb4312ba80b39ae4b4835a3fd58e649" dependencies = [ "byteorder", "bytes", diff --git a/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml b/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml index a514784a..9765b4df 100644 --- a/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml +++ b/plugins/websocket/examples/svelte-app/src-tauri/Cargo.toml @@ -13,7 +13,7 @@ tauri = { version = "1", features = [] } tokio = { version = "1", features = ["net"] } futures-util = "0.3" tauri-plugin-websocket = { path = "../../../" } -tokio-tungstenite = "0.19" +tokio-tungstenite = "0.20" [build-dependencies] tauri-build = { version = "1", features = [] } diff --git a/plugins/websocket/src/lib.rs b/plugins/websocket/src/lib.rs index 55676e12..a26f6ae2 100644 --- a/plugins/websocket/src/lib.rs +++ b/plugins/websocket/src/lib.rs @@ -45,7 +45,8 @@ struct ConnectionManager(Mutex>); #[derive(Default, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ConnectionConfig { - pub max_send_queue: Option, + pub write_buffer_size: Option, + pub max_write_buffer_size: Option, pub max_message_size: Option, pub max_frame_size: Option, pub accept_unmasked_frames: bool, @@ -53,9 +54,15 @@ pub struct ConnectionConfig { impl From for WebSocketConfig { fn from(config: ConnectionConfig) -> Self { + // Disabling the warning on max_send_queue which we don't use anymore since it was deprecated. + #[allow(deprecated)] Self { - max_send_queue: config.max_send_queue, + max_send_queue: None, + write_buffer_size: config.write_buffer_size.unwrap_or(128 * 1024), + max_write_buffer_size: config.max_write_buffer_size.unwrap_or(usize::MAX), + // This may be harmful since if it's not provided from js we're overwriting the default value with None, meaning no size limit. max_message_size: config.max_message_size, + // This may be harmful since if it's not provided from js we're overwriting the default value with None, meaning no size limit. max_frame_size: config.max_frame_size, accept_unmasked_frames: config.accept_unmasked_frames, } diff --git a/plugins/websocket/tsconfig.json b/plugins/websocket/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/websocket/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/websocket/tsconfig.json b/plugins/websocket/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/websocket/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/plugins/window-state/tsconfig.json b/plugins/window-state/tsconfig.json deleted file mode 120000 index 7cd38da8..00000000 --- a/plugins/window-state/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/window-state/tsconfig.json b/plugins/window-state/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/plugins/window-state/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +} diff --git a/shared/template/tsconfig.json b/shared/template/tsconfig.json deleted file mode 120000 index 4ec6ff6a..00000000 --- a/shared/template/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../tsconfig.json \ No newline at end of file diff --git a/shared/template/tsconfig.json b/shared/template/tsconfig.json new file mode 100644 index 00000000..5098169a --- /dev/null +++ b/shared/template/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["guest-js/*.ts"] +}