push_notifications: Reduce log level for weird warning.

This issue isn't something a system administrator needs to take action
on -- it's a likely minor logic bug around organization
administrators moving topics between streams.

As a result, it shouldn't send error emails to administrators.
This commit is contained in:
Tim Abbott 2020-07-16 01:21:59 -07:00
parent 4f9f6b18e7
commit 289819fb70
2 changed files with 3 additions and 3 deletions

View File

@ -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'],
)

View File

@ -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')