[backup-client] Uploading logs
Summary:
ENG-5557 : Add support for uploading logs from backup clients
This diff adds an option to create a websocket connection, upload logs and receive upload confirmations from the backup service. The stream/sink from tungstenite is mapped so that the clients only deal with business logic. The reconnection etc. will be handled in the outside code.
Depends on D10457
Test Plan:
Tested with next diffs from commtest and native mobile devices. Tested with this code:
let (tx, rx) = backup_client .upload_logs(&user_identity, &backup_data.backup_id) .await .unwrap(); tokio::pin!(tx); tokio::pin!(rx); for log_data in log_datas { tx.send(log_data.clone()).await.unwrap(); } let result: HashSet<usize> = rx.take(log_datas.len()).try_collect().await.unwrap(); let expected = log_datas.iter().map(|data| data.log_id).collect(); assert_eq!(result, expected);
Reviewers: bartek, kamil
Reviewed By: bartek
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D10532