mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
alert_words: Update remove_alert_word codepath to send event on commit.
Earlier, we were immediately enqueueing event in 'do_remove_alert_words' which can lead to a situation, if any db operation is added after enqueueing event in future, where the action function fails at a later stage. Events should not be sent until we know we're not rolling back. Fixes part of #30489.
This commit is contained in:
committed by
Tim Abbott
parent
ba80266b7e
commit
dc27711399
@@ -18,6 +18,7 @@ def do_add_alert_words(user_profile: UserProfile, alert_words: Iterable[str]) ->
|
||||
notify_alert_words(user_profile, words)
|
||||
|
||||
|
||||
@transaction.atomic(savepoint=False)
|
||||
def do_remove_alert_words(user_profile: UserProfile, alert_words: Iterable[str]) -> None:
|
||||
words = remove_user_alert_words(user_profile, alert_words)
|
||||
notify_alert_words(user_profile, words)
|
||||
|
||||
Reference in New Issue
Block a user