diff --git a/autopush/tests/test_websocket.py b/autopush/tests/test_websocket.py index e9af778d..d7d0cc81 100644 --- a/autopush/tests/test_websocket.py +++ b/autopush/tests/test_websocket.py @@ -1420,7 +1420,8 @@ def test_ack(self): assert_called_included(self.proto.log.info, format="Ack", router_key="simplepush", - message_source="direct") + message_source="direct", + message_id=str(12)) def test_ack_with_bad_input(self): self._connect() @@ -1445,7 +1446,8 @@ def test_ack_with_webpush_direct(self): assert_called_included(self.proto.log.info, format="Ack", router_key="webpush", - message_source="direct") + message_source="direct", + message_id=dummy_version) def test_ack_with_webpush_from_storage(self): self._connect() diff --git a/autopush/web/simplepush.py b/autopush/web/simplepush.py index 3be346a2..e7b03e5d 100644 --- a/autopush/web/simplepush.py +++ b/autopush/web/simplepush.py @@ -109,7 +109,7 @@ def put(self, subscription, version, data): self._client_info.update( uaid_hash=hasher(user_data.get("uaid")), channel_id=user_data.get("chid"), - message_id=version, + message_id=str(version), router_key=user_data["router_type"] ) notification = Notification( diff --git a/autopush/websocket.py b/autopush/websocket.py index 2011ecd1..429d34e6 100644 --- a/autopush/websocket.py +++ b/autopush/websocket.py @@ -1445,7 +1445,7 @@ def _handle_simple_ack(self, chid, version, code): self.ps.direct_updates[chid] <= version: del self.ps.direct_updates[chid] self.log.info(format="Ack", router_key="simplepush", - channel_id=chid, message_id=version, + channel_id=chid, message_id=str(version), message_source="direct", uaid_hash=self.ps.uaid_hash, user_agent=self.ps.user_agent, code=code, @@ -1453,7 +1453,7 @@ def _handle_simple_ack(self, chid, version, code): self.ps.stats.direct_acked += 1 return self.log.info(format="Ack", router_key="simplepush", channel_id=chid, - message_id=version, message_source="stored", + message_id=str(version), message_source="stored", uaid_hash=self.ps.uaid_hash, user_agent=self.ps.user_agent, code=code, **self.ps.raw_agent) @@ -1491,7 +1491,7 @@ def process_nack(self, data): return self.log.info(format="Nack", uaid_hash=self.ps.uaid_hash, - user_agent=self.ps.user_agent, message_id=version, + user_agent=self.ps.user_agent, message_id=str(version), code=code, **self.ps.raw_agent) self.ps.stats.nacks += 1