mattermost / desktop

Mattermost Desktop application for Windows, Mac and Linux
Apache License 2.0
2.03k stars 829 forks source link

[Bug]: Desktop client does not connect to server with auto-launch on startup + auto-launch minimized #3212

Open raphraph opened 2 days ago

raphraph commented 2 days ago

Checks before filing an issue

Mattermost Desktop Version

5.9.0

Operating System

Linux Ubuntu 22.04 LTS

Mattermost Server Version

9.11.5

Steps to reproduce

Set the app to :

Reboot machine. The app auto-launches correctly, and auto-launches minimized (no window is opened, and app icon appears in the task bar).

Expected behavior

The client should connect to the server (this is the normal behavior of an app running in the background) so that the user can be notified of new messages.

Otherwise the auto-launch minimized setting is useless as in order to be connected to the server I need to manually open the window and then minimize it again manually...

Observed behavior

I have to open the app window once in order that Mattermost fully launches. As long as I don't open the app window, Mattermost is not fully launched (not connected to the server) and I do not receive any notifications when a message is sent.

Once I open the app window once, I see that the app is connecting to the server, and then notifications will work fine event if I minimize the window again.

I observed that if I do not set the auto-launch minimized setting everything works ok : Mattermost launches on my machine startup, the app window opens and it connects to the server. If I then minimize the window notifications work fine.

Log Output

This is the log output of the autostart of yesterday when the problem occured (but it was set on "info" level, I will add later a full debug log when I have one) :

[2024-11-18 08:36:56.803] [error] Logger Log level set to: info
[2024-11-18 08:36:57.091] [warn]  [App.Initialize] Current working directory is /home/username, changing into /opt/Mattermost
[2024-11-18 08:36:58.958] [info]  [App.Config] config.autostart has been configured: true
[2024-11-18 08:36:59.273] [info]  [App.Initialize] Autoupgrade disabled: false
[2024-11-18 08:36:59.387] [info]  [ServerDropdownView] init
[2024-11-18 08:36:59.509] [info]  [i18nManager] Set new language fr
[2024-11-18 08:37:00.106] [info]  [App.Config] config.autostart has been configured: true
[2024-11-18 08:37:02.843] [info]  [App.Config] config.autostart has been configured: true

Additional Information

No response

devinbinnie commented 2 days ago

@raphraph Does this reproduce on v5.10?

raphraph commented 2 days ago

I don't know yet, I didn't get any update notification for v5.10. But I can say that this bug has been active for a few past versions at least (I don't remember when it started...).

devinbinnie commented 2 days ago

@raphraph Can you manually install v5.10 and try it out? There are always new fixes with new versions.

raphraph commented 2 days ago

I just dit (it was actually available in the updates). I will report asap if it is fixed or not.

raphraph commented 21 hours ago

@devinbinnie I just tested and it still does not work.

Strangely I found this 2021 discussion on the forum which seems to answer to someone talking about this problem and stating that this is "the expected behavior"... If that really is the expected behavior, I really don't understand what's the point of having an "auto-launch minimized" setting which behaves no differently than if there wasn't any auto-launch (same number of actions needed in order to be connected to the server and notified from incoming messages).

In the meantime I will continue to use the auto-launch setting not minimized and minimize manually the window on startup. But I find it strange that this has not been considered a bug sooner... is this working correctly on other setups ?

Thanks !

devinbinnie commented 15 hours ago

Strangely I found this 2021 discussion on the forum which seems to answer to someone talking about this problem and stating that this is "the expected behavior"...

I think what they're referring to is someone asking if the app should autostart without having been opened once in the first place, the auto start entry is added when the app is launched, so it can't add anything without first launching the app once.

As for the minimize issue, I'll have a look and see if I can reproduce.