mail
mail copied to clipboard
'Mark all as read' doesn't work
Steps to reproduce
- Open Mail App and ensure multiple messages are unread
- Use context menu on folder and choose to "Mark all as read"
- Verify if the messages have been marked as read
Expected behavior
All messages should be marked as read and the number of unread emails should be 0
Actual behavior
No emails are marked as read.
Mail app version
1.13.8
Mailserver or service
generic imap
Operating system
Windows 10
PHP engine version
PHP 8.1
Web server
No response
Database
No response
Additional info
Using Nextcloud VM Trying to mark all as read in my "Archive" folder.
Just following up to indicate that this is still a bug as of Mail v2.0.0-beta.4 (NC 25 beta5)
I've tested and its works. @st3iny could you reproduce it?
@JuliaKirschenheuter Which version are you testing against?
I'm on 2.0.0-rc.1 and I don't see anything in the browser console. I do see the following in the nextcloud logs:
{
"reqId": "uFkeYxdfHbFcL918hAJt",
"level": 3,
"time": "2022-10-03T12:42:58-04:00",
"remoteAddr": "ip address",
"user": "username",
"app": "PHP",
"method": "POST",
"url": "/apps/mail/api/mailboxes/29/sync",
"message": "Return type of OCA\\Mail\\AddressList::count() should either be compatible with Countable::count(): int, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at /var/www/nextcloud/apps/mail/lib/AddressList.php#108",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0",
"version": "25.0.0.14",
"exception": {
"Exception": "Error",
"Message": "Return type of OCA\\Mail\\AddressList::count() should either be compatible with Countable::count(): int, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at /var/www/nextcloud/apps/mail/lib/AddressList.php#108",
"Code": 0,
"Trace": [
{
"file": "/var/www/nextcloud/apps/mail/lib/AddressList.php",
"line": 39,
"function": "onAll",
"class": "OC\\Log\\ErrorHandler",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/composer/composer/ClassLoader.php",
"line": 571,
"args": [
"/var/www/nextcloud/apps/mail/lib/AddressList.php"
],
"function": "include"
},
{
"file": "/var/www/nextcloud/lib/composer/composer/ClassLoader.php",
"line": 428,
"function": "Composer\\Autoload\\includeFile"
},
{
"file": "/var/www/nextcloud/apps/mail/lib/Db/Message.php",
"line": 143,
"function": "loadClass",
"class": "Composer\\Autoload\\ClassLoader",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/public/AppFramework/Db/Entity.php",
"line": 68,
"function": "__construct",
"class": "OCA\\Mail\\Db\\Message",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"line": 322,
"function": "fromRow",
"class": "OCP\\AppFramework\\Db\\Entity",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"line": 340,
"function": "mapRowToEntity",
"class": "OCP\\AppFramework\\Db\\QBMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/mail/lib/Db/MessageMapper.php",
"line": 1031,
"function": "findEntities",
"class": "OCP\\AppFramework\\Db\\QBMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
"line": 174,
"function": "findByIds",
"class": "OCA\\Mail\\Db\\MessageMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
"line": 133,
"function": "getDatabaseSyncChanges",
"class": "OCA\\Mail\\Service\\Sync\\SyncService",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
"line": 160,
"function": "syncMailbox",
"class": "OCA\\Mail\\Service\\Sync\\SyncService",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 225,
"function": "sync",
"class": "OCA\\Mail\\Controller\\MailboxesController",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 133,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
"line": 172,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Route/Router.php",
"line": 298,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/base.php",
"line": 1047,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/var/www/nextcloud/index.php",
"line": 36,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/var/www/nextcloud/lib/private/Log/ErrorHandler.php",
"Line": 99,
"CustomMessage": "--"
},
"id": "633b145489250"
}
I just tested this on latest main and couldn't reproduce it. Please let us know which IMAP server are using. Also, could you please run occ mail:account:diagnose <account-id>. You can get the account id by running occ mail:account:export <user-id>.
@st3iny I'm using zoho: imappro.zoho.com
Here's the diagnostics:
''' IMAP capabilities:- ACL- AUTH- CHILDREN- CONDSTORE- ESEARCH- ID- IDLE- IMAP4REV1- LIST-EXTENDED- LIST-STATUS- LITERAL-- MOVE- NAMESPACE- SASL-IR- UIDPLUS- UNSELECT- WITHIN- XLISTAccount has 72006 messages in 12 mailboxes '''
Dear @meichthys
we can't reproduce this bug anymore. Please update dependencies and please try to reproduce this bug again (after clicking to "Mark all as read" it needs 1-2 seconds). If you would reproduce it, i will have a look again.
For now i'll close this ticket. Thank you!
@st3iny Is there a specific IMAP capability that is required for this to work? It works on the default mail app on my phone, but not in nextcloud mail :/
@JuliaKirschenheuter I do see the "Mark all as read" option grey out for about 1-2 seconds, but even after waiting for a significant amount of time, the unread items are still unread:

Afaik, all of my dependencies are up to date.
I'm also using the Nextcloud VM and i believe that comes with the needed dependencies. Could it be that the mailbox is too large (over 60k messages)? I'm thinking this may be the case since I can get it to work on a small folder:
Before:
After:

Are the messages marked as read in other clients?
The log points toward a PHP8.1 incompatibility:
"message": "Return type of OCA\\Mail\\AddressList::count() should either be compatible with Countable::count(): int, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at /var/www/nextcloud/apps/mail/lib/AddressList.php#108",
Can you see what is in your file? We have added that Attribute already.
A deprecation notice doesn't interrupt the application flow.
Are the messages marked as read in other clients?
Yes it works fine in thunderbird.
@miaulalala Here's the contents around line 108 in /var/www/nextcloud/apps/mail/lib/AddressList.php:
#[ReturnTypeWillChange]
public function jsonSerialize() {
return array_map(function (Address $address) {
return $address->jsonSerialize();
}, $this->addresses);
}
/**
* @return int
*/
public function count() { <---------- Line 108
return count($this->addresses);
}
Are the messages marked as read in other clients?
Yes it works fine in thunderbird.
If mark all as read here shows all messages as rad in Thunderbird problem is not a missing update of the messages on IMAP but that our app doesn't reflect the changes.
Just following up here to indicate that i'm still seeing this issue in v2.3.0A1
This worked in v 3.3.0-alpha.1 (maybe it would work in earlier versions too?). It did, however, lock up my Firefox browser tab. I had to force re-fresh the tab to get the page to re-load, after which the folder was completely marked as read!
So the only issue now is that you have to force re-fresh to see the change?
I think the performance could be improved by not sending a request for every envelope to the server but instead sending one request and having the server change every envelope.
That way, if you client crahes, the server should still successfully carry out the operation.
I can't think of any argument against this.
So the only issue now is that you have to force re-fresh to see the change?
It seems like clearing the cache in the nextcloud mail folder works as well - but this required debug mode to be turned on for nextcloud.
I don't know the backend so if this was to be implemented then someone else'd need to do it.