Switch to reqwest #990
ci.yaml
on: pull_request
Check code formatting
12s
Clippy
1m 18s
Matrix: build
Annotations
1 error and 21 warnings
Build / Rust nightly
The process '/home/runner/.cargo/bin/cargo' failed with exit code 101
|
Check code formatting
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Build / Rust nightly
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Build / Rust nightly
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
passing a unit value to a function:
src/websocket/mod.rs#L202
warning: passing a unit value to a function
--> src/websocket/mod.rs:202:9
|
202 | / Ok(loop {
203 | | futures::select! {
204 | | _ = ka_interval.tick().fuse() => {
205 | | use prost::Message;
... |
312 | | }
313 | | })
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
= note: `#[warn(clippy::unit_arg)]` on by default
help: move the expression in front of the call and replace it with the unit literal `()`
|
202 ~ loop {
203 + futures::select! {
204 + _ = ka_interval.tick().fuse() => {
205 + use prost::Message;
206 + tracing::debug!("sending keep-alive");
207 + let request = WebSocketRequestMessage {
208 + id: Some(self.next_request_id()),
209 + path: Some(self.keep_alive_path.clone()),
210 + verb: Some("GET".into()),
211 + ..Default::default()
212 + };
213 + self.outgoing_keep_alive_set.insert(request.id.unwrap());
214 + let msg = WebSocketMessage {
215 + r#type: Some(web_socket_message::Type::Request.into()),
216 + request: Some(request),
217 + ..Default::default()
218 + };
219 + let buffer = msg.encode_to_vec();
220 + if let Err(e) = self.ws.send(reqwest_websocket::Message::Binary(buffer)).await {
221 + tracing::info!("Websocket sink has closed: {:?}.", e);
222 + break;
223 + };
224 + },
225 + // Process requests from the application, forward them to Signal
226 + x = self.requests.next() => {
227 + match x {
228 + Some((mut request, responder)) => {
229 + use prost::Message;
230 +
231 + // Regenerate ID if already in the table
232 + request.id = Some(
233 + request
234 + .id
235 + .filter(|x| !self.outgoing_request_map.contains_key(x))
236 + .unwrap_or_else(|| self.next_request_id()),
237 + );
238 + tracing::trace!(
239 + "sending WebSocketRequestMessage {{ verb: {:?}, path: {:?}, body (bytes): {:?}, headers: {:?}, id: {:?} }}",
240 + request.verb,
241 + request.path,
242 + request.body.as_ref().map(|x| x.len()),
243 + request.headers,
244 + request.id,
245 + );
246 +
247 + self.outgoing_request_map.insert(request.id.unwrap(), responder);
248 + let msg = WebSocketMessage {
249 + r#type: Some(web_socket_message::Type::Request.into()),
250 + request: Some(request),
251 + ..Default::default()
252 + };
253 + let buffer = msg.encode_to_vec();
254 + self.ws.send(reqwest_websocket::Message::Binary(buffer)).await?
255 + }
256 + None => {
257 + return Err(ServiceError::WsClosing {
258 + reason: "SignalWebSocket: end of application request stream; socket closing"
259 + });
260 + }
261 + }
262 + }
263 + web_socket_item = self.ws.next().fuse() => {
264 + use reqwest_websocket::Message;
265 + match web_socket_item {
266 + Some(Ok(Message::Close { code, reason })) => {
267 + tracing::warn!(%code, reason, "websocket closed");
268 + break;
269 + },
270 + Some(Ok(Message::Binary(frame))) => {
271 + self.process_frame(frame).await?;
272 + }
273 + Some(Ok(Message::Ping(_))) => {
274 + tracing::trace!("received ping");
275 + }
276 + Some(Ok(Message::Pong(_))) => {
277 + tracing::trace!("received pong");
278 + }
279 + Some(Ok(Message::Text(_))) => {
280 + tracing::trace!("received text (unsupported, skipping)");
281 + }
282 + Some(Err(e)) => return Err(ServiceError::WsError(e)),
283 + None => {
284 + return Err(ServiceError::WsClosing {
285 + reason: "end of web request stream; socket closing"
286 + });
287 + }
288 + }
289 + }
290 + response = self.outgoing_responses.next() => {
291 + use prost::Message;
292 + match response {
293 + Some(Ok(response)) => {
294 + tracing::trace!("sending response {:?}", response);
295 +
296 + let msg = WebSocketMessage {
297 + r#type: Some(web_socket_message::Type::Response.into()),
298 + response: Some(response),
299 + ..Default::default()
300 + };
301 + let buffer = msg.encode_to_vec();
302 + self.ws.send(buffer.into()).await?;
303 + }
304 + Some(Err(e)) => {
305 + tracing::error!("could not generate response to a Signal request; responder was canceled: {}. Continuing.", e);
306 + }
307 + None => {
308 + unreachable!("outgoing responses should never fuse")
309 + }
310 + }
311 + }
312 + }
313 + };
314 + Ok(())
|
|
useless conversion to the same type: `&str`:
src/websocket/mod.rs#L132
warning: useless conversion to the same type: `&str`
--> src/websocket/mod.rs:132:33
|
132 | reason: "request handler failed".into(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"request handler failed"`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/push_service/mod.rs#L161
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/push_service/mod.rs:161:21
|
161 | &cfg.certificate_authority.as_bytes(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `cfg.certificate_authority.as_bytes()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
src/push_service/registration.rs#L311
warning: the borrowed expression implements the required traits
--> src/push_service/registration.rs:311:13
|
311 | &format!("/v1/verification/session/{}/code", session_id),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v1/verification/session/{}/code", session_id)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/push_service/registration.rs#L287
warning: the borrowed expression implements the required traits
--> src/push_service/registration.rs:287:13
|
287 | &format!("/v1/verification/session/{}/code", session_id),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v1/verification/session/{}/code", session_id)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/push_service/registration.rs#L240
warning: the borrowed expression implements the required traits
--> src/push_service/registration.rs:240:13
|
240 | &format!("/v1/verification/session/{}", session_id),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v1/verification/session/{}", session_id)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/push_service/keys.rs#L54
warning: the borrowed expression implements the required traits
--> src/push_service/keys.rs:54:13
|
54 | &format!("/v2/keys?identity={}", service_id_type),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v2/keys?identity={}", service_id_type)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/push_service/keys.rs#L36
warning: the borrowed expression implements the required traits
--> src/push_service/keys.rs:36:13
|
36 | &format!("/v2/keys?identity={}", service_id_type),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v2/keys?identity={}", service_id_type)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
useless conversion to the same type: `&str`:
src/messagepipe.rs#L100
warning: useless conversion to the same type: `&str`
--> src/messagepipe.rs:100:25
|
100 | reason: "could not respond to message pipe request".into(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"could not respond to message pipe request"`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
the borrowed expression implements the required traits:
src/account_manager.rs#L256
warning: the borrowed expression implements the required traits
--> src/account_manager.rs:256:17
|
256 | &format!("/v1/provisioning/{}", destination),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v1/provisioning/{}", destination)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
Build / Rust beta
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Build / Rust beta
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Clippy
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Build / Rust 1.75
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Build / Rust 1.75
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Build / Rust stable
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Build / Rust stable
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|