mail icon indicating copy to clipboard operation
mail copied to clipboard

Never ending desktop notifications for new emails

Open ChristophWurst opened this issue 2 years ago • 12 comments

Steps to reproduce

  1. Set up an account
  2. Leave the tab alone
  3. Receive a new email

Expected behavior

I get a desktop notification once

Actual behavior

I get a desktop notification about the very same message every 30 seconds.

Mail app version

3.5.0 RC3

Mailserver or service

No response

Operating system

No response

PHP engine version

None

Web server

None

Database

None

Additional info

No response

ChristophWurst avatar Dec 04 '23 09:12 ChristophWurst

This could be caused by https://github.com/nextcloud/mail/pull/8231.

@hamza221 could you try to reproduce?

ChristophWurst avatar Dec 04 '23 10:12 ChristophWurst

image

the message is constantly reported as new

ChristophWurst avatar Dec 04 '23 10:12 ChristophWurst

The thread has two latest messages because they were sent at the exact same unix timestamp. This seems to make the sorting toggle between one or the other message constantly, therefore creating desktop notifications.

We can lower the priority of this fix

ChristophWurst avatar Dec 04 '23 15:12 ChristophWurst

Happens on my prod instance too now using Mail v3.5.0-rc.3

ChristophWurst avatar Dec 11 '23 07:12 ChristophWurst

Request Response
Bildschirmfoto vom 2023-12-11 08-45-31 Bildschirmfoto vom 2023-12-11 08-45-45

It is the request that syncs my INBOX in the background, not the sync of the priority inbox that is shown.

On the console I see some related errors:

image

Which tells us that the messages are removed on thefrontend. With the next background sync, they are brought back. Then deleted, synced again, deleted …

ChristophWurst avatar Dec 11 '23 07:12 ChristophWurst

Setting priority back to high because this is quite annoying to get the notification every 30s. It makes me close the Mail tab.

ChristophWurst avatar Dec 11 '23 08:12 ChristophWurst

It only happens with more than one account

ChristophWurst avatar Dec 11 '23 18:12 ChristophWurst

I can reproduce with one account

hamza221 avatar Dec 11 '23 18:12 hamza221

Only one account set https://github.com/nextcloud/mail/assets/40746210/ed33e2e7-68be-42d6-a637-889020d8932e

hamza221 avatar Dec 11 '23 18:12 hamza221

The issue I'm hunting shows that \OCA\Mail\Service\Sync\SyncService::getDatabaseSyncChanges is called with message ids that belong to another mailbox.

I'm trying to track it down. It's an issue somewhere in the frontend. https://github.com/nextcloud/mail/blame/19b07d65e814c98107bfee11c18eeda300995c01/src/store/mutations.js#L287 is definitely suspicious. With two accounts, addEnvelopes is called three times. Account 1's inbox, account 2's inbox and then the unified inbox. But the combined envelope lists have the first or second account's inbox mailbox_id set on the first envelope. This wrongly adds all envelopes there.

ChristophWurst avatar Dec 11 '23 19:12 ChristophWurst

This actually makes perfect sense. Envelopes were added two two mailboxes. At sync, one mailbox was fine, for there other there were some alien entries that are removed. At the next sync they return where they belong and the foreign mailbox. Then the process goes in an endless cycle.

ChristophWurst avatar Dec 11 '23 19:12 ChristophWurst

Unfortunately, I have to inform you that this error has recently occurred for me on NC 29.0.5 and Mail 3.7.7. Every 20-30 seconds one notification. It's really annoying. image All "new" messages are already read multiple days ago.

SafetyIng avatar Aug 26 '24 10:08 SafetyIng

This should be fixed by https://github.com/nextcloud/mail/pull/10176.

Thank you for your report @SafetyIng

ChristophWurst avatar Nov 13 '24 14:11 ChristophWurst