Signal-desktop: Unhandled Promise Rejection TypeError: Cannot read property 'isVisible'

Created on 26 Mar 2020  Â·  41Comments  Â·  Source: signalapp/Signal-Desktop

Hi,
My signal desktop app on Windows 10 just auto-updated to the next latest release version v1.32.2 but after asking me to restart it crashed and I got the below error. Now whenever I try to launch it with my shortcut that uses the "-use-tray-icon --start-in-tray flags" I get the same error that pops up with an option to quit or copy & quit. The error it copies is:

Unhandled Promise Rejection

TypeError: Cannot read property 'isVisible' of undefined
at Tray.tray.updateContextMenu ([REDACTED]\app.asar\app\tray_icon.js:71:36)
at createTrayIcon ([REDACTED]\app.asar\app\tray_icon.js:111:8)
at App. ([REDACTED]\app.asar\main.js:884:12)

My desktop shortcut I use is "C:\Users\R-MAIN\AppData\Local\Programs\signal-desktop\Signal.exe --use-tray-icon --start-in-tray"

I can launch it without those flags but not with them. This happened immdiately after asking me to restart to auto-update to v1.32.2

Any thoughts? Thank you.

image

Bug Should Be Fixed

Most helpful comment

Please install v1.32.3 folks.

All 41 comments

Encountered same problem. As long as one of --use-tray-icon or --start-in-tray is passed as an argument, the error shows up.

Unfortunately no obvious way to rollback to prev version...

ditto. i am also calling by "Signal.exe --use-tray-icon --start-in-tray" in a fully patched Win10 machine.

note that this error/bug was in the beta (the issue is listed a few items below this one.

Same here - updated earlier tonight and having this error when using these options as well.

I'm having the same error on Ubuntu 19.10 / Regolith 1.3.1

I hope there's an option for us to control when to update, much better if we can specify the version.
I always think the latest version is not that stable, I'd like the previous one.

Same here as well with '--start-in-tray' , Xubuntu 19.10.

Is there usually any testing done on a new Signal version? I started to get reluctant to update, confirmed by this issue now, having the impression that too frequently some thing stops to work correctly with a new version (and despite many updates, still no audio/video, which would be so useful these days).

+1

Windows 10

Same here Win10, using --start-in-tray

EDIT: Works when removing the line. Annoying.

@sirius-c You might try matrix or better the client riot.im there you have video /audio everywhere. But its another messenger.

Same here. Trouble with either --use-tray-icon or --start-in-tray flag enabled.

Unhandled Promise Rejection

TypeError: Cannot read property 'isVisible' of undefined
    at Tray.tray.updateContextMenu ([REDACTED]\app.asar\app\tray_icon.js:71:36)
    at createTrayIcon ([REDACTED]\app.asar\app\tray_icon.js:111:8)
    at App.<anonymous> ([REDACTED]\app.asar\main.js:884:12)

I guess this might caused by commit https://github.com/signalapp/Signal-Desktop/commit/750e50812c575913580966d2e25378d696ba3ddd at 8 hours ago, on March 26, 2020. And the latest release of v1.32.2 at 7 hours ago (https://github.com/signalapp/Signal-Desktop/releases/tag/v1.32.2) included this change to the tray_icon.js file (see difference at https://github.com/signalapp/Signal-Desktop/commit/750e50812c575913580966d2e25378d696ba3ddd#diff-1e93a15ff1db4bd6b0fce52ca01e7161).

EDIT:
See @ElderThorin 's reply and his correction. Thanks! Appreciate the correction!

same here in Linux mint 19

Same problem here (Windows 10). The use of the '--start-in-tray' commandline option triggers this problem.

Same problem here, KDE neon 5.18

People, stop posting "me too"!!

People, stop posting "me too"!!

This should give more info about the systems and the amount of users affected by this issue.
Or do I confuse things?

People, stop posting "me too"!!

This should give more info about the systems and the amount of users affected by this issue.
Or do I confuse things?

I think it is pretty clear that this affects all systems. No need to spam the issue with noise.

I have bisected this in Git on Fedora Linux 31.

$ git bisect bad
52e594901f6f30269e7bbe45b94b68eb9f7419f7 is the first bad commit
commit 52e594901f6f30269e7bbe45b94b68eb9f7419f7
Author: Ken Powers <[email protected]>
Date:   Wed Mar 25 20:32:20 2020 -0400

    Use Electron Spellchecker

 _locales/en/messages.json    |  16 ++++
 app/spell_check.js           | 102 +++++++++++++++++++++++++
 js/background.js             |  14 ----
 js/spell_check.js            | 172 -------------------------------------------
 js/views/settings_view.js    |  21 +++++-
 main.js                      |  25 ++++++-
 package.json                 |   3 -
 patches/typo-js+1.1.0.patch  | Bin 553 -> 0 bytes
 preload.js                   |  24 +++---
 settings.html                |   3 +
 settings_preload.js          |   2 +
 test/index.html              |   1 -
 test/spellcheck_test.js      |  15 ----
 ts/util/lint/exceptions.json |  56 ++++++--------
 yarn.lock                    | 103 --------------------------
 15 files changed, 199 insertions(+), 358 deletions(-)
 create mode 100644 app/spell_check.js
 delete mode 100644 js/spell_check.js
 delete mode 100644 patches/typo-js+1.1.0.patch
 delete mode 100644 test/spellcheck_test.js

Okay, understood.

From: mandree notifications@github.com
Sent: Donnerstag, 26. März 2020 10:16
To: signalapp/Signal-Desktop Signal-Desktop@noreply.github.com
Cc: Markus Schlager m.schlager@esri.ch; Comment comment@noreply.github.com
Subject: Re: [signalapp/Signal-Desktop] Unhandled Promise Rejection TypeError: Cannot read property 'isVisible' (#4085)

I have bisected this in Git

$ git bisect bad
52e5949https://github.com/signalapp/Signal-Desktop/commit/52e594901f6f30269e7bbe45b94b68eb9f7419f7 is the first bad commit
commit 52e5949https://github.com/signalapp/Signal-Desktop/commit/52e594901f6f30269e7bbe45b94b68eb9f7419f7
Author: Ken Powers [email protected]ken@signal.org
Date: Wed Mar 25 20:32:20 2020 -0400

Use Electron Spellchecker

_locales/en/messages.json | 16 ++++
app/spell_check.js | 102 +++++++++++++++++++++++++
js/background.js | 14 ----
js/spell_check.js | 172 -------------------------------------------
js/views/settings_view.js | 21 +++++-
main.js | 25 ++++++-
package.json | 3 -
patches/typo-js+1.1.0.patch | Bin 553 -> 0 bytes
preload.js | 24 +++---
settings.html | 3 +
settings_preload.js | 2 +
test/index.html | 1 -
test/spellcheck_test.js | 15 ----
ts/util/lint/exceptions.json | 56 ++++++--------
yarn.lock | 103 --------------------------
15 files changed, 199 insertions(+), 358 deletions(-)
create mode 100644 app/spell_check.js
delete mode 100644 js/spell_check.js
delete mode 100644 patches/typo-js+1.1.0.patch
delete mode 100644 test/spellcheck_test.js

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/signalapp/Signal-Desktop/issues/4085#issuecomment-604316434, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AK52JD7IIMHUDP643PLAYP3RJMMOVANCNFSM4LT42XVQ.

Confirm the same error on Ubuntu-Mate 19.10
removing --use-tray-icon from command line does work, but feels like quite a ridiculous workaround

Same here. Trouble with either --use-tray-icon or --start-in-tray flag enabled.

Unhandled Promise Rejection

TypeError: Cannot read property 'isVisible' of undefined
    at Tray.tray.updateContextMenu ([REDACTED]\app.asar\app\tray_icon.js:71:36)
    at createTrayIcon ([REDACTED]\app.asar\app\tray_icon.js:111:8)
    at App.<anonymous> ([REDACTED]\app.asar\main.js:884:12)

I guess this might caused by commit 750e508 at 8 hours ago, on March 26, 2020. And the latest release of v1.32.2 at 7 hours ago (https://github.com/signalapp/Signal-Desktop/releases/tag/v1.32.2) included this change to the tray_icon.js file (see difference at 750e508#diff-1e93a15ff1db4bd6b0fce52ca01e7161).

I believe that change is on the dev branch and actually will fix this issue. Don't use github much, could be misreading.

I believe that change is on the dev branch and actually will fix this issue. Don't use github much, could be misreading.

Yes, I agree with @ElderThorin 's correction! After I re-read the release page of v1.32.2 and v1.33.0-beta.4 , I should make correction to my previous comment!

So, in Releases it says

v1.32.2 @scottnonnenberg-signal scottnonnenberg-signal released this 13 hours ago · 33 commits to development since this release
v1.33.0-beta.4
@scottnonnenberg-signal scottnonnenberg-signal released this 14 hours ago
Fixes an issue where Signal Desktop might crash on startup if --use-tray-icon or --start-in-tray was provided
Fixes an issue where Signal Desktop was unable to react to messages in a group

This means, there're currently 33 new commits in the development branch. One of the commits should be able to fix (or maybe not fix). And the label v1.33.0-beta.4 will be working on to fix this tray icon issue soon!

See @mandree is working on commit https://github.com/mandree/Signal-Desktop/commit/c2294ea8aedafe1a802eca382703456b3e20313a and PR https://github.com/signalapp/Signal-Desktop/pull/4090 to try to fix the issue. Thanks ElderThorin for correction. And thanks mandree for working on the solution!

I think a backup before updating is a good way.
It's too scary and inconvenient when it crashes on start.

@ax4 For a released branch I was going for the minimum workable change. Let someone else sort out the betas.

Sorry for the update storm - this was minimizing the fix, the minimum result is adding await before createWindow();

Maintainers, feel free to clone this comment into a new issue and mention me.

Note that - from looking at the code - apparently also the development branch as of 750e5081 and checking 9c3196a90 again is apparently fixing the wrong place.

While it fixes the immediate broken Promise and the resulting crash, the actual issue to me appears that the createWindow() function was very recently made async with the exchange of the spell checker, but the invocation in the app.on('ready', ...) handler in main.js (and there is one more macOS-specific handler which I know nothing about) does not await the completion of createWindow() before it tries to add the tray icon - this is what appears to be causing the createTrayIcon() to fail in the first place: the window hasn't been created and cannot be referenced.

So I propose to also cherry-pick 569fa1f from my fork to development also, and possibly revert the addition of mainWindow && to app/tray_icon.js as of 750e5081. I'll add that to my fork for your convenience.

So I've stripped the master branch in my fork down to just the "await" change, removing the node version change and the version bump. The two commits immediately referenced above are the changes for the v1.33-beta development (9ad42fe) and v1.32.x master branch (6251b71), respectively.

All, do not download Signal from any location other than https://signal.org/download. I've deleted the previous comment.

My signal desktop app on Win10 just auto-updated to v1.32.3 and now the "--use-tray-icon --start-in-tray" flags work again! Thanks for the quick fix!

Please install v1.32.3 folks.

After updating to 1.32.3 I no longer see any errors, but no icon is showing either.

Debug log: https://paste.ubuntu.com/p/2mqJF83MPp/

@morten-b What operating system (with version) and what desktop environment are you using?

v1.32.3 working as expected here on Ubuntu-Mate 19.10 including tray icon

For missing icon, see #3974 and #4082.

Version 1.32.3 is working fine again on Kubuntu 19.10

Great job, very well done, fine on win7.

Win10Enterprise, working, symbols seems fine, also after locking and unlocking the pc. Thanks!

Is there usually any testing done on a new Signal version?

Unfortunately, the tray icon is still considered Beta and a hidden feature… Maybe used by too few people.

People, stop posting "me too"!!

This should give more info about the systems and the amount of users affected by this issue.

It's probably better to upvote previous comments if their poster is on the same platform.

It's probably better to upvote previous comments if their poster is on the same platform.

Will do in the future.

I'm om Ubuntu 19.10 with Regolith 1.3.1 which is baser on i3. Nextcloud tray icon i showing as expected.

-------- Original Message --------
On 26 Mar 2020, 21:53, mandree wrote:

@morten-b What operating system (with version) and what desktop environment are you using?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Windows 10, Signal v1.32.3: --start-in-tray option works again.

@morten-b when you Google, you'll find that Electron 8 and i3 appear to be incompatible WRT tray icon support. Different worlds. Electron 8 talks new world, i3 understands old world. Sorry, I didn't save the reference. Note that your situation has nothing to do with the bug that was reported here, and does not belong into this issue.

Reports since 1.32.3 have been about incompatibility between Electron 8 and the Linux Desktop Environment's respective app/tray icon handling and belong either into existing, or possibly new, issues, and possibly not even with Signal-Desktop, and it appears the madness of the various trayicon/appindicator/kstatusnotifier schemes in the fragmented Linux desktop universe continues.

Excellent feedback! Out of curiosity, when was this issue introduced? I have had the icon until recently.

-------- Original Message --------
On 27 Mar 2020, 11:36, mandree wrote:

@morten-b when you Google, you'll find that Electron 8 and i3 appear to be incompatible WRT tray icon support. Different worlds. Electron 8 talks new world, i3 understands old world. Sorry, I didn't save the reference. Note that your situation has nothing to do with the bug that was reported here, and does not belong into this issue.

Reports since 1.32.3 have been about incompatibility between Electron 8 and the Linux Desktop Environment's respective app/tray icon handling and belong either into existing, or possibly new, issues, and possibly not even with Signal-Desktop, and it appears the madness of the various trayicon/appindicator/kstatusnotifier schemes in the fragmented Linux desktop universe continues.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Was this page helpful?
0 / 5 - 0 ratings