Bug 462735 - Race condition between Unity counter service and autostarted apps, causing them to sometimes lose their Task Manager notification badges until they're restarted
Summary: Race condition between Unity counter service and autostarted apps, causing th...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Startup process (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Salvatore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-07 07:55 UTC by Salvatore
Modified: 2024-01-13 18:30 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
On the left, Telegram started automatically when the system started, on the right, the app after closing and restarting it (63.69 KB, image/png)
2022-12-07 07:55 UTC, Salvatore
Details
Log without badge (14.64 KB, text/plain)
2022-12-24 13:28 UTC, Salvatore
Details
log with badge (29.48 KB, text/plain)
2022-12-24 13:29 UTC, Salvatore
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Salvatore 2022-12-07 07:55:04 UTC
Created attachment 154385 [details]
On the left, Telegram started automatically when the system started, on the right, the app after closing and restarting it

SUMMARY

When Telegram is launched at system startup, the badge is not shown. If you close and reopen the app, the badge returns


STEPS TO REPRODUCE
1.  Telegram autostart - unread messages but no badge
2. close telegram and restart it, the badge return


Operating System: Arch Linux
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7
Kde Gear: 22.08.3
Comment 1 Nate Graham 2022-12-07 20:31:54 UTC
IIRC this is a Qt issue of some sort. Ilya, do you remember which one?
Comment 2 Ilya Fedin 2022-12-07 20:34:45 UTC
That Qt issue is about system tray icon, the icon on screenshot is the taskbar one, i.e. it seems to be a different issue, with the com.canonical.Unity.LauncherEntry API
Comment 3 Nate Graham 2022-12-09 00:56:01 UTC
An issue with the API itself, not its implementation in Plasma or Telegram?
Comment 4 Ilya Fedin 2022-12-09 01:01:34 UTC
Somewhere in its implementation I believe, whether in Plasma or Telegram it's a question though. Telegram does a simple NameHasOwner check (and then logs the result to its log.txt) on launch, maybe there's a similar race condition.
Comment 5 Ilya Fedin 2022-12-09 01:13:29 UTC
If that's the case, the fix on Telegram side would be as easy as removing the check, it probably won't hurt if the signal is always emitted. But that would likely also mean Plasma doesn't accept requests to the API in first seconds applications are auto-started, so the issue will be harder to reproduce, but it won't disappear (e.g. in case Telegram or some other application sets the counter on start and there's no new messages for a long time, so no new requests to the API are made).
Comment 6 Bug Janitor Service 2022-12-24 05:23:55 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Ilya Fedin 2022-12-24 10:57:40 UTC
Salvatore, I believe you need to provide Telegram's log.txt to validate the assumption
Comment 8 Salvatore 2022-12-24 13:28:56 UTC
Created attachment 154801 [details]
Log without badge
Comment 9 Salvatore 2022-12-24 13:29:15 UTC
Created attachment 154802 [details]
log with badge
Comment 10 Ilya Fedin 2022-12-24 13:30:47 UTC
Indeed, I see "Not using Unity launcher counter." line in the log without counter
Comment 11 Salvatore 2022-12-24 13:42:03 UTC
(In reply to Ilya Fedin from comment #10)
> Indeed, I see "Not using Unity launcher counter." line in the log without
> counter

Excuse my ignorance, is this a package I didn't install?
Comment 12 Ilya Fedin 2022-12-24 14:27:02 UTC
This means Plasma launches Telegram earlier than it starts the Unity counter service