mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
handle_missedmessage_emails: Update codepath to queue event on commit.
Earlier, in 'handle_missedmessage_emails' codepath we were using 'queue_json_publish' which can lead to a situation where we enqueue events but the transaction fails at a later stage. Events should not be published until we know we're not rolling back.
This commit is contained in:
committed by
Tim Abbott
parent
f0cbce564d
commit
4bef1a510c
@@ -49,6 +49,7 @@ from zerver.actions.realm_settings import (
|
||||
from zerver.actions.streams import bulk_add_subscriptions, bulk_remove_subscriptions
|
||||
from zerver.decorator import do_two_factor_login
|
||||
from zerver.lib.cache import bounce_key_prefix_for_testing
|
||||
from zerver.lib.email_notifications import MissedMessageData, handle_missedmessage_emails
|
||||
from zerver.lib.initial_password import initial_password
|
||||
from zerver.lib.mdiff import diff_strings
|
||||
from zerver.lib.message import access_message
|
||||
@@ -2241,6 +2242,12 @@ class ZulipTestCase(ZulipTestCaseMixin, TestCase):
|
||||
# immediately run the worker for it, producing the thumbnails.
|
||||
return self.upload_image(image_name)
|
||||
|
||||
def handle_missedmessage_emails(
|
||||
self, user_profile_id: int, message_ids: dict[int, MissedMessageData]
|
||||
) -> None:
|
||||
with self.captureOnCommitCallbacks(execute=True):
|
||||
handle_missedmessage_emails(user_profile_id, message_ids)
|
||||
|
||||
|
||||
def get_row_ids_in_all_tables() -> Iterator[tuple[str, set[int]]]:
|
||||
all_models = apps.get_models(include_auto_created=True)
|
||||
|
||||
Reference in New Issue
Block a user