mattermost / desktop

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

[Bug]: Notification banners and sound are not played on macOS when FocusStatus permission is denied #3052

Closed blackout400 closed 1 month ago

blackout400 commented 1 month ago

Checks before filing an issue

Mattermost Desktop Version

5.8.0

Operating System

Mac OS Sonoma 14.5

Mattermost Server Version

9.5.1

Steps to reproduce

Install Mattermost 5.8 from AppStore or Github. Receive notification.

Expected behavior

Notifications must work as set in Mattermost and Mac OS notification settings.

Observed behavior

No sound, banner or icon bounce. Only red badge on dock icon.

Log Output

[2024-06-06 10:28:55.391] [error] Logger Log level set to: info
[2024-06-06 10:28:55.440] [warn]  [Config] Failed to load configuration file from the filesystem. Using defaults.
[2024-06-06 10:28:55.441] [info]  [Config] Migrating config items successfully.
[2024-06-06 10:28:55.449] [warn]  [App.Initialize] Current working directory is /, changing into /Applications/Mattermost.app/Contents/MacOS
[2024-06-06 10:28:55.514] [info]  [App.Initialize] Autoupgrade disabled: false
[2024-06-06 10:28:55.516] [error] [MainWindow] Error: ENOENT: no such file or directory, open '/Users/yaroslav/Library/Application Support/Mattermost/bounds-info.json'
    at Object.readFileUtf8 (node:internal/fs/sync:25:18)
    at Object.readFileSync (node:fs:441:19)
    at t.readFileSync (node:electron/js2c/node_init:2:9771)
    at P.getSavedWindowState (/Applications/Mattermost.app/Contents/Resources/app.asar/index.js:2:801342)
    at P.init (/Applications/Mattermost.app/Contents/Resources/app.asar/index.js:2:798156)
    at P.show (/Applications/Mattermost.app/Contents/Resources/app.asar/index.js:2:800256)
    at /Applications/Mattermost.app/Contents/Resources/app.asar/index.js:2:212929
    at Vr (/Applications/Mattermost.app/Contents/Resources/app.asar/index.js:2:213641)
[2024-06-06 10:28:55.580] [info]  [ServerDropdownView] init
[2024-06-06 10:28:55.588] [info]  [i18nManager] Set new language ru
[2024-06-06 10:28:55.664] [error] [App.Utils] clearAppCache TypeError: Object has been destroyed
[2024-06-06 10:28:55.744] [info]  [ModalView] [welcomeScreen] preloading with /Applications/Mattermost.app/Contents/Resources/app.asar/internalAPI.js
[2024-06-06 10:29:28.372] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Unable to load bundle for plugin com.github.matterpoll.matterpoll, version 1.5.0
[2024-06-06 10:29:28.867] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Not authorized

[2024-06-06 10:29:57.132] [info]  [App.App] Handling deeplinking url: mattermost://mm.corp.server_name/login/desktop?client_token=7376933ae604dee21c26f186a2546cd8b89a2d773b78f8a586ff149092d67650&server_token=dhhd9myaaxokmncgqx6ra449p3ahysmzdxxt7boxwyipaajopp3t3hadngkrfc6c
[2024-06-06 10:29:57.636] [info]  [WebContentsEventM...] [server_name] [TAB_MESSAGING] https://mm.corp.server_name/
[2024-06-06 10:30:02.488] [info]  [App.App] Handling deeplinking url: mattermost://mm.corp.server_name/login/desktop/?client_token=7376933ae604dee21c26f186a2546cd8b89a2d773b78f8a586ff149092d67650&server_token=dhhd9myaaxokmncgqx6ra449p3ahysmzdxxt7boxwyipaajopp3t3hadngkrfc6c
[2024-06-06 10:30:02.538] [info]  [WebContentsEventM...] [server_name] [TAB_MESSAGING] https://mm.corp.server_name/
[2024-06-06 10:30:02.546] [info]  [App.App] Handling deeplinking url: mattermost://mm.corp.server_name/login/desktop/?client_token=7376933ae604dee21c26f186a2546cd8b89a2d773b78f8a586ff149092d67650&server_token=dhhd9myaaxokmncgqx6ra449p3ahysmzdxxt7boxwyipaajopp3t3hadngkrfc6c
[2024-06-06 10:30:09.553] [info]  [WebContentsEventM...] [server_name] [TAB_MESSAGING] https://mm.corp.server_name/
[2024-06-06 10:30:09.566] [info]  [App.App] Handling deeplinking url: mattermost://mm.corp.server_name/login/desktop/?client_token=7376933ae604dee21c26f186a2546cd8b89a2d773b78f8a586ff149092d67650&server_token=dhhd9myaaxokmncgqx6ra449p3ahysmzdxxt7boxwyipaajopp3t3hadngkrfc6c
[2024-06-06 10:30:18.054] [info]  [App.App] Handling deeplinking url: mattermost://mm.corp.server_name/login/desktop?client_token=7376933ae604dee21c26f186a2546cd8b89a2d773b78f8a586ff149092d67650&server_token=dhhd9myaaxokmncgqx6ra449p3ahysmzdxxt7boxwyipaajopp3t3hadngkrfc6c
[2024-06-06 10:30:27.284] [error] Logger Log level set to: info
[2024-06-06 10:30:27.337] [warn]  [App.Initialize] Current working directory is /, changing into /Applications/Mattermost.app/Contents/MacOS
[2024-06-06 10:30:27.385] [info]  [App.Initialize] Autoupgrade disabled: false
[2024-06-06 10:30:27.455] [info]  [ServerDropdownView] init
[2024-06-06 10:30:27.463] [info]  [i18nManager] Set new language ru
[2024-06-06 10:30:28.292] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Unable to load bundle for plugin com.github.matterpoll.matterpoll, version 1.5.0
[2024-06-06 10:30:40.632] [info]  [ModalView] [newServer] preloading with /Applications/Mattermost.app/Contents/Resources/app.asar/internalAPI.js
[2024-06-06 10:30:40.739] [error] [WebContentsEventM...] [renderer] Refused to load the image 'data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 fill=%27none%27 stroke=%27%23dc3545%27 viewBox=%270 0 12 12%27%3e%3ccircle cx=%276%27 cy=%276%27 r=%274.5%27/%3e%3cpath stroke-linejoin=%27round%27 d=%27M5.8 3.6h.4L6 6.5z%27/%3e%3ccircle cx=%276%27 cy=%278.2%27 r=%27.6%27 fill=%27%23dc3545%27 stroke=%27none%27/%3e%3c/svg%3e' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

[2024-06-06 10:30:53.914] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 10:31:23.876] [warn]  [WebContentsEventM...] [MGVC] [TAB_MESSAGING] [renderer] com.mattermost.calls: failed to open translations file for locale 'ru' Error: Cannot find module './ru.json'
[2024-06-06 10:31:24.784] [warn]  [WebContentsEventM...] [MGVC] [TAB_MESSAGING] [renderer] Legacy preload initialized
[2024-06-06 10:33:19.961] [info]  [ModalView] [settingsModal] preloading with /Applications/Mattermost.app/Contents/Resources/app.asar/internalAPI.js
[2024-06-06 10:33:33.142] [info]  [ModalView] [settingsModal] preloading with /Applications/Mattermost.app/Contents/Resources/app.asar/internalAPI.js
[2024-06-06 10:33:40.311] [error] Logger Log level set to: info
[2024-06-06 10:33:40.364] [warn]  [App.Initialize] Current working directory is /, changing into /Applications/Mattermost.app/Contents/MacOS
[2024-06-06 10:33:40.416] [info]  [App.Initialize] Autoupgrade disabled: false
[2024-06-06 10:33:40.484] [info]  [ServerDropdownView] init
[2024-06-06 10:33:40.488] [info]  [i18nManager] Set new language ru
[2024-06-06 10:33:41.235] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Unable to load bundle for plugin com.github.matterpoll.matterpoll, version 1.5.0
[2024-06-06 10:33:41.694] [warn]  [WebContentsEventM...] [MGVC] [TAB_MESSAGING] [renderer] com.mattermost.calls: failed to open translations file for locale 'ru' Error: Cannot find module './ru.json'
[2024-06-06 10:33:42.130] [warn]  [WebContentsEventM...] [MGVC] [TAB_MESSAGING] [renderer] Legacy preload initialized
[2024-06-06 10:35:40.649] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 10:45:06.922] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 10:47:32.653] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 10:55:59.141] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 10:56:46.242] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 10:57:27.273] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 10:57:50.058] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:01:10.384] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:08:28.598] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:09:24.253] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:14:56.589] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:15:08.091] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:20:16.554] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:22:57.513] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:23:22.464] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:23:31.220] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:47:35.399] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:47:46.767] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:47:54.141] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:48:20.407] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:48:27.926] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:48:28.319] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:48:31.859] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:48:43.956] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:52:23.347] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:58:04.503] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:58:13.886] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:58:17.657] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:58:47.420] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:59:01.358] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 11:59:03.036] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:04:53.198] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:04:57.435] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:05:03.921] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:06:02.875] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:07:22.315] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:07:25.220] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:15:09.487] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:15:48.718] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:17:28.725] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:24:51.970] [info]  [ModalView] [editServer] preloading with /Applications/Mattermost.app/Contents/Resources/app.asar/internalAPI.js
[2024-06-06 12:24:52.067] [error] [WebContentsEventM...] [renderer] Refused to load the image 'data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 fill=%27none%27 stroke=%27%23dc3545%27 viewBox=%270 0 12 12%27%3e%3ccircle cx=%276%27 cy=%276%27 r=%274.5%27/%3e%3cpath stroke-linejoin=%27round%27 d=%27M5.8 3.6h.4L6 6.5z%27/%3e%3ccircle cx=%276%27 cy=%278.2%27 r=%27.6%27 fill=%27%23dc3545%27 stroke=%27none%27/%3e%3c/svg%3e' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

[2024-06-06 12:25:14.883] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:26:19.968] [info]  [ModalView] [editServer] preloading with /Applications/Mattermost.app/Contents/Resources/app.asar/internalAPI.js
[2024-06-06 12:26:20.070] [error] [WebContentsEventM...] [renderer] Refused to load the image 'data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 fill=%27none%27 stroke=%27%23dc3545%27 viewBox=%270 0 12 12%27%3e%3ccircle cx=%276%27 cy=%276%27 r=%274.5%27/%3e%3cpath stroke-linejoin=%27round%27 d=%27M5.8 3.6h.4L6 6.5z%27/%3e%3ccircle cx=%276%27 cy=%278.2%27 r=%27.6%27 fill=%27%23dc3545%27 stroke=%27none%27/%3e%3c/svg%3e' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

[2024-06-06 12:35:01.148] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:45:35.484] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:45:50.134] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:52:47.322] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2
[2024-06-06 12:52:48.072] [error] [WebContentsEventM...] [server_name] [TAB_MESSAGING] [renderer] Uncaught (in promise) Error: Error invoking remote method 'notify_mention': TypeError: FocusStatus access not authorized, status: 2

Additional Information

Same for me as for "fragpit" here - https://github.com/mattermost/desktop/issues/3044#issuecomment-2142030417

Notifications does not work on 5.8. It was fine on 5.7 version, but after update from AppStore to 5.8 notification banner and sound completely disappeared, dock icon does not bounce, only red badge shows on it. Tried to completely remove Mattermost from the system via AppCleaner and then install 5.8 again - no notifications. Tested 5.7 - works fine. Also works fine in browser. Tried to disable and enable the notifications back in system settings with no luck. As far as i know all needed apps permissions are granted.

I saw the error "FocusStatus access not authorized", but i don't use focusing on my mac. Still checked it - found nothing that might cause notifications block.

gmcinalli commented 1 month ago

Hi @blackout400, I had the same problem, I solved by giving permission to Focus sharing (Privacy & Security in Settings app) and then restarting the app.

At the first received message it asked me for permission to send me notifications, I allowed it and the notifications started working again.

Unfortunately, if I disable the Focus sharing option the notifications don't work again, there is probably some bug blocking the notification flow.

PS: Edit the issue title with relevant informations about this bug.

devinbinnie commented 1 month ago

@blackout @gmcinalli The above should work, you can also do sudo tccutil reset FocusStatus Mattermost.Desktop in the command line. It looks like the notification code is requiring that focus status be given permission before continuing. I've also noticed that it asks for the microphone when playing sound, which is odd. I'll look into both.