1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-03-01 17:26:12 +00:00

Prevent race condition

This commit is contained in:
M66B 2023-11-14 11:22:12 +01:00
parent 4c41baa3d8
commit 6491532c2d

View file

@ -5619,8 +5619,12 @@ class Core {
if (message.notifying == 0) {
// Handle clear notifying on boot/update
data.groupNotifying.get(group).remove(message.id);
data.groupNotifying.get(group).remove(-message.id);
EntityMessage msg = db.message().getMessage(message.id);
if (msg != null && msg.notifying == 0) {
EntityLog.log(context, "Notify boot=" + msg.id);
data.groupNotifying.get(group).remove(msg.id);
data.groupNotifying.get(group).remove(-msg.id);
}
} else {
long id = message.id * message.notifying;
if (!data.groupNotifying.get(group).contains(id) &&