From ae2f3b4a01368717fa69eee7019e8b6f72da38f5 Mon Sep 17 00:00:00 2001 From: Ben Bangert Date: Mon, 23 Apr 2018 16:47:32 -0700 Subject: [PATCH] fix: return simple uaid to hello Closes #1185 --- autopush/tests/test_integration.py | 3 ++- autopush_rs/src/client.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/autopush/tests/test_integration.py b/autopush/tests/test_integration.py index 422f3c82..19b1b1f0 100644 --- a/autopush/tests/test_integration.py +++ b/autopush/tests/test_integration.py @@ -122,6 +122,7 @@ def hello(self, uaid=None, services=None): result = json.loads(self.ws.recv()) log.debug("Recv: %s", result) assert result["status"] == 200 + assert "-" not in result["uaid"] if self.uaid and self.uaid != result["uaid"]: # pragma: nocover log.debug("Mismatch on re-using uaid. Old: %s, New: %s", self.uaid, result["uaid"]) @@ -1234,7 +1235,7 @@ def test_webpush_monthly_rotation(self): yield deferToThread( self.conn.db.message.table.delete_item, Key={'uaid': client.uaid, 'chidmessageid': ' '} - ) + ) # Verify the channel is gone exists, chans = yield deferToThread( diff --git a/autopush_rs/src/client.rs b/autopush_rs/src/client.rs index 23d6de9a..5cd31349 100644 --- a/autopush_rs/src/client.rs +++ b/autopush_rs/src/client.rs @@ -408,7 +408,7 @@ where message_month, connected_at, stats: SessionStatistics { - uaid: uaid.hyphenated().to_string(), + uaid: uaid.simple().to_string(), uaid_reset: reset_uaid, existing_uaid: check_storage, connection_type: String::from("webpush"), @@ -420,7 +420,7 @@ where srv.connect_client(RegisteredClient { uaid, uid, tx }); let response = ServerMessage::Hello { - uaid: uaid.hyphenated().to_string(), + uaid: uaid.simple().to_string(), status: 200, use_webpush: Some(true), broadcasts: Service::into_hashmap(broadcasts),