Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Promise Rejection TypeError: Cannot read property 'isVisible' #4085

Closed
rob4226 opened this issue Mar 26, 2020 · 41 comments
Closed

Comments

@rob4226
Copy link

rob4226 commented Mar 26, 2020

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

@yz778
Copy link

yz778 commented Mar 26, 2020

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...

@fisixer
Copy link

fisixer commented Mar 26, 2020

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.

@morrow95
Copy link

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

@morten-b
Copy link

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

@lhzw
Copy link

lhzw commented Mar 26, 2020

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.

@ghost
Copy link

ghost commented Mar 26, 2020

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).

@scma-esrich
Copy link

+1

Windows 10

@natrius
Copy link

natrius commented Mar 26, 2020

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.

@ax4
Copy link

ax4 commented Mar 26, 2020

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).

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

@thevops
Copy link

thevops commented Mar 26, 2020

same here in Linux mint 19

@mhantsch
Copy link

mhantsch commented Mar 26, 2020

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

@R4PS
Copy link

R4PS commented Mar 26, 2020

Same problem here, KDE neon 5.18

@mandree
Copy link
Contributor

mandree commented Mar 26, 2020

People, stop posting "me too"!!

@scma-esrich
Copy link

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?

@mandree
Copy link
Contributor

mandree commented Mar 26, 2020

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.

@mandree
Copy link
Contributor

mandree commented Mar 26, 2020

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

@scma-esrich
Copy link

scma-esrich commented Mar 26, 2020 via email

@lhzw lhzw mentioned this issue Mar 26, 2020
1 task
@Lion-box
Copy link

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

@ElderThorin
Copy link

ElderThorin commented Mar 26, 2020

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.

@ax4
Copy link

ax4 commented Mar 26, 2020

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 #4090 to try to fix the issue. Thanks ElderThorin for correction. And thanks mandree for working on the solution!

@lhzw
Copy link

lhzw commented Mar 26, 2020

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

@mandree
Copy link
Contributor

mandree commented Mar 26, 2020

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

@mandree
Copy link
Contributor

mandree commented Mar 26, 2020

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

@mandree
Copy link
Contributor

mandree commented Mar 26, 2020

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 750e508 and checking 9c3196a 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 750e508. I'll add that to my fork for your convenience.

@mandree
Copy link
Contributor

mandree commented Mar 26, 2020

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.

scottnonnenberg-signal pushed a commit that referenced this issue Mar 26, 2020
Between v1.32.1 and v1.32.2, createMainWindow() was made an async function, so createTrayIcon() and setupMenu() were called too early.

await createMainWindow() before adding the tray icon and menu.

Fixes #4085.

Co-authored-by: Matthias Andree <[email protected]>
@scottnonnenberg-signal
Copy link
Contributor

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

@rob4226
Copy link
Author

rob4226 commented Mar 26, 2020

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!

popey pushed a commit to snapcrafters/signal-desktop that referenced this issue Mar 26, 2020
This issue should now be resolved with 1.32.3
signalapp/Signal-Desktop#4085
@josh-signal
Copy link
Contributor

Please install v1.32.3 folks.

@morten-b
Copy link

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/

@mandree
Copy link
Contributor

mandree commented Mar 26, 2020

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

@Lion-box
Copy link

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

@mandree
Copy link
Contributor

mandree commented Mar 26, 2020

For missing icon, see #3974 and #4082.

@CryptoD
Copy link

CryptoD commented Mar 26, 2020

Version 1.32.3 is working fine again on Kubuntu 19.10

@lhzw
Copy link

lhzw commented Mar 27, 2020

Great job, very well done, fine on win7.

@natrius
Copy link

natrius commented Mar 27, 2020

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

@itkfm
Copy link

itkfm commented Mar 27, 2020

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.

@scma-esrich
Copy link

scma-esrich commented Mar 27, 2020

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

Will do in the future.

@morten-b
Copy link

morten-b commented Mar 27, 2020 via email

@mhantsch
Copy link

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

@mandree
Copy link
Contributor

mandree commented Mar 27, 2020

@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.

@morten-b
Copy link

morten-b commented Mar 27, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.