mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
Previously, MissedMessageWorker used a batching strategy of just grabbing all the events from the last 2 minutes, and then sending them off as emails. This suffered from the problem that you had a random time, between 0s and 120s, to edit your message before it would be sent out via an email. Additionally, this made the queue had to monitor, because it was expected to pile up large numbers of events, even if everything was fine. We fix this by batching together the events using a timer; the queue processor itself just tracks the items, and then a timer-handler process takes care of ensuring that the emails get sent at least 120s (and at most 130s) after the first triggering message was sent in Zulip. This introduces a new unpleasant bug, namely that when we restart a Zulip server, we can now lose some missed_message email events; further work is required on this point. Fixes #6839.