Unpredictable badge activity?
Opened this issue · 12 comments
Using the latest ElectronMail 5.22. Observed on both Kubuntu and Windows 10.
The unread mail badge that appears over the green ElectronMail icon in the system tray when minimized is now red instead of blue. That's not really a problem, except that as far as I can understand so far, it's now behaving erratically.
I've tested several times today. This morning at around 10 Pacific time it worked as expected. I saw the icon appear, opened ElectronMail, opened the message and the icon went away as expected.
Then I tried it again at noon and 2pm, and the red icon never appeared, but the test email was waiting once I manually opened the ElectronMail program and checked.
I finally posted this issue when just now I saw the red icon, opened the unread message, and the red icon would not go off until I unloaded the account in question and then reloaded it.
Either I don't know how to configure my settings, or something may be wrong.
Thanks for a fantastic program, hope I get it working right again.
k3n51mm
The guess is that Proton has changed some API related to receiving summary "unread" information. Will have to look into it in a debugger to say something specific.
It appears to keep working well if the local store option is enabled for the mail account - the app doesn't scan the summary "unread" API calls in this case, but derives the unread counters from the own local database.
I just did a brief testing on one account and one mail by switching its "unread" status on/off, and could not reproduce the issue so far. So I'm not jumping into the debugging yet, but will do if more issue reports come here.
Just to follow up. I still haven't figured out why the badge wasn't working normally just after installing, but it has "settled down" since posting this issue. Being a developer myself, I'm still suspicious of whatever happened, but there appears to be nothing wrong with Electron Mail - as long as Proton Mail is working correctly. Thanks for looking into it.
Well the problem has recurred. Upon restarting the machine where Electronmail is installed after a Windows update, it started fine, no problems with logging into the several accounts at Proton Mail. However, I later received several emails and the red badge didn't appear; I only discovered them by opening the Electronmail screen. Then I sent a test email and again no badge.. So I restarted Electronmail, all accounts logged in successfully, but still no badge. Just tried it again with the same result.
Some screenshots would help I guess, to reduce possibility for misunderstanding.
Please note the icon in the system tray with no new email badge, and the unread email displayed once the Electronmail screen is opened. In addition, when operating as you intended, there is usually another rounded square icon which shows the number of unread messages, shown at the left of the tab of the email account which has the unread message. I rely on this great program, so I'm glad to help with testing if needed. THX
The issue like this could potentially happen if Proton has changed /v4/messages/count
API format or the address, as the app scans the response of this API. So going to look into it in a debugger.
Much appreciated, pls let me know if you have a monetization channel, this is a fantastic program and I'm happy to pay or donate. Thx, KS
I did some debugging and the above-mentioned API scans appear valid. I can't reproduce the issue yet at my side.
I'm surprised no one except you reported the issue so far, which makes me think Proton might have some account-related setting which makes unread counters related logic work differently in terms of API use. @k3n51mm was it worked for you as expected before v5.2.2?
Btw, I normally use the local store feature enabled for the account and in this case unread notification value calculation works differently (deriving unread values from the local database vs scanning the response of /core/v4/events
/ /mail/v4/messages/count
API calls), you could try it too.
Also, currently if the local store is not enabled for the account, the app shows unread notification for the Inbox
folder only. I'm changing it to "all folders" by 8378e3b, so it works similar in both modes.
if you have a monetization channel
No such channel at the moment, but you could subscribe to #258 if you wish.
I have changed all accounts to 'local store', and the notifications seem to be working again. Maybe there's something changed in the web API calls as you surmised. Thanks! KS
@Dementor316, so far I couldn't reproduce the issue at my side, and there were no related changes in the project code between versions 5.2.1 and 5.2.2. So it's either Proton changed things which I briefly debugged and didn't detect the issue there, or some dependencies, including @electron itself, got updated with this side effect.
Is there a correct unread counter in the app itself, inside the account handle button? If so, then the app still correctly detects/derives the unread counter, but the notification itself doesn't get displayed for some reason. You can try making alternative/external notification by putting similar code to the "Shell command execution"
edit area located under the "Desktop Notifications"
block on the account edit form (I didn't test the powershell "[console]::beep(500,300)"
code as currently there is no Windows system at my side, but it's supposed to make beep sound):
formatNotificationShellExecArguments(() => {
return {command: `powershell "[console]::beep(500,300)"`};
});
Also, if you have enabled "Shell command execution"
or/and "Custom notification content"
toggles located under that collapsible "Desktop Notifications"
block, try disabling them both and see if it helps.
the problem only arises with displaying the number of unread messages on the tray icon and system notifications.
Thanks for confirming a guess, so the issue scope got narrowed down now.