Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

push_notifications: Reduce log level for weird warning.

Tim Abbott289819fb7034
diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py
index 07b280b2456..43313457f94 100644
--- a/zerver/lib/push_notifications.py
+++ b/zerver/lib/push_notifications.py
@@ -770,7 +770,7 @@ def handle_push_notification(user_profile_id: int, missed_message: Dict[str, Any
# If the cause is a race with the message being deleted,
# that's normal and we have no need to log an error.
return
- logging.error(
+ logging.info(
"Unexpected message access failure handling push notifications: %s %s",
user_profile.id, missed_message['message_id'],
)
diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py
index 5ad43a065ac..a6aea896c95 100644
--- a/zerver/tests/test_push_notifications.py
+++ b/zerver/tests/test_push_notifications.py
@@ -878,13 +878,13 @@ class HandlePushNotificationTest(PushNotificationTest):
# This should log an error
with mock.patch('zerver.lib.push_notifications.uses_notification_bouncer') as mock_check, \
- mock.patch('logging.error') as mock_logging_error, \
+ mock.patch('logging.info') as mock_logging_info, \
mock.patch('zerver.lib.push_notifications.push_notifications_enabled', return_value = True) as mock_push_notifications:
handle_push_notification(user_profile.id, missed_message)
mock_push_notifications.assert_called_once()
# Check we didn't proceed through.
mock_check.assert_not_called()
- mock_logging_error.assert_called_once()
+ mock_logging_info.assert_called_once()
def test_send_notifications_to_bouncer(self) -> None:
user_profile = self.example_user('hamlet')