Page MenuHomePhabricator

D5536.id18663.diff
No OneTemporary

D5536.id18663.diff

diff --git a/services/tunnelbroker/src/server/mod.rs b/services/tunnelbroker/src/server/mod.rs
--- a/services/tunnelbroker/src/server/mod.rs
+++ b/services/tunnelbroker/src/server/mod.rs
@@ -99,7 +99,7 @@
))
}
};
- let _session_item = match getSessionItem(&session_id) {
+ let session_item = match getSessionItem(&session_id) {
Ok(database_item) => database_item,
Err(err) => return Err(Status::unauthenticated(err.what())),
};
@@ -129,6 +129,28 @@
return Err(Status::internal(err.what()));
}
+ // Checking for an empty notif token and requesting the new one from the client
+ if session_item.notifyToken.is_empty()
+ && session_item.deviceType
+ == tunnelbroker::new_session_request::DeviceTypes::Mobile as i32
+ {
+ let result = tx_writer(
+ &session_id,
+ &tx,
+ Ok(tunnelbroker::MessageToClient {
+ data: Some(
+ tunnelbroker::message_to_client::Data::NewNotifyTokenRequired(()),
+ ),
+ }),
+ );
+ if let Err(err) = result.await {
+ debug!(
+ "Error while sending notification token request to the client: {}",
+ err
+ );
+ };
+ }
+
// Spawning asynchronous Tokio task with the client pinging loop inside to
// make sure that the client is online
tokio::spawn({

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 8:15 PM (16 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2690743
Default Alt Text
D5536.id18663.diff (1 KB)

Event Timeline