activity icon indicating copy to clipboard operation
activity copied to clipboard

Possible race condition between `EmailNotification` BG job and `occ activity:send-emails`

Open pabzm opened this issue 10 months ago • 0 comments

https://docs.nextcloud.com/server/27/admin_manual/configuration_server/activity_configuration.html#better-scheduling-of-activity-emails recommends running occ activity:send-emails from cron.

Meanwhile there's no way (that I'm aware of) to disable the EmailNotification background job without also disabling the other background jobs.

So both code triggers are active and might run at the same time.

The email-sending code loops over a list of users that should receive an email, and after all that email sending is done, deletes all items from the affected users.

So if both, the background job and the cron job, run overlapping, they might send emails twice.

pabzm avatar Feb 18 '25 12:02 pabzm