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

Signal app always restarts setup wizard even it's already configured #5704

Closed
onny opened this issue Feb 14, 2017 · 19 comments
Closed

Signal app always restarts setup wizard even it's already configured #5704

onny opened this issue Feb 14, 2017 · 19 comments
Assignees

Comments

@onny
Copy link

onny commented Feb 14, 2017

Hey,
I'm using the crypto messenger Signal-Desktop 0.28.0 successfully with the latest stable nwjs version 0.20.2 on ArchLinux x86_64, installed as described here for Ubuntu or using the AUR buildscript.
The program runs fine and is usable but unfortunately the setup wizard also restarts every time I launch the app :( Here's the debug output:

~/projects/Signal-Desktop-0.28.0 % nw --enable-logging=stderr dist                                                                          
[16549:16549:0214/130845.779265:WARNING:password_store_factory.cc(248)] Using basic (unencrypted) store for password storage. See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_password_storage.md for more information about password storage options.
[16549:16549:0214/130845.952185:WARNING:push_messaging_service_factory.cc(30)] PushMessagingService could not be built because InstanceID is unexpectedly disabled
[16549:16549:0214/130846.376818:INFO:CONSOLE(49)] "pre-main prep time: 4 ms", source: chrome-extension://oihbcgnadkoghkblklnjohjipmjljndg/js/debugLog.js (49)
[16549:16549:0214/130846.457639:INFO:CONSOLE(49)] "background page reloaded", source: chrome-extension://oihbcgnadkoghkblklnjohjipmjljndg/js/debugLog.js (49)
[16549:16549:0214/130846.479294:WARNING:launcher.cc(280)] Extension does not provide a valid file handler.
[16549:16549:0214/130846.550532:INFO:CONSOLE(49)] "extension launched", source: chrome-extension://oihbcgnadkoghkblklnjohjipmjljndg/js/debugLog.js (49)
[16549:16549:0214/130846.693200:INFO:CONSOLE(49)] "opening websocket", source: chrome-extension://oihbcgnadkoghkblklnjohjipmjljndg/js/debugLog.js (49)
[16549:16549:0214/130846.694795:INFO:CONSOLE(49)] "opening message socket", source: chrome-extension://oihbcgnadkoghkblklnjohjipmjljndg/js/debugLog.js (49)
[16549:16549:0214/130846.698466:INFO:CONSOLE(49)] "open inbox", source: chrome-extension://oihbcgnadkoghkblklnjohjipmjljndg/js/debugLog.js (49)
[16549:16549:0214/130847.059005:INFO:CONSOLE(49)] "opening provisioning socket", source: chrome-extension://oihbcgnadkoghkblklnjohjipmjljndg/js/debugLog.js (49)
[16549:16549:0214/130847.236136:INFO:CONSOLE(49)] "websocket open", source: chrome-extension://oihbcgnadkoghkblklnjohjipmjljndg/js/debugLog.js (49)

That's how it looks like:
2016-12-08-133726_swaygrab
On the left there's the setup wizard and on the right there's the already configured programm running.

I'll look into further logging and debuging issues and maybe someone can help me here further!
Thanks and best regards,
Jonas

@xzhan96
Copy link
Contributor

xzhan96 commented Feb 23, 2017

@onny sorry, I am not very clear about this description:

but unfortunately the setup wizard also restarts every time I launch the app

How should I do to reproduce?

@onny
Copy link
Author

onny commented Feb 23, 2017

Thank you for your response.
This bug is still present in

  • signal app v0.30.0
  • nwjs 0.20.3

Here are the steps to reproduce this issue:

  • Installation instructions for Ubuntu
sudo aptitude install npm ruby-sass nodejs-legacy
cd /tmp
wget "https://github.com/WhisperSystems/Signal-Desktop/archive/v0.30.0.tar.gz"
tar xvf v0.30.0.tar.gz
cd Signal-Desktop-0.30.0
npm install
node_modules/grunt-cli/bin/grunt -f
cd /tmp 
wget "https://dl.nwjs.io/v0.20.3/nwjs-v0.20.3-linux-x64.tar.gz"
tar xvf nwjs-v0.20.3-linux-x64.tar.gz
nwjs-v0.20.3-linux-x64/nw Signal-Desktop-0.30.0/dist

Now the app starts like this
2017-02-23-163033_swaygrab
So far, so good. Now you have to register to the Signal messaging service. You'll need the Signal app on your smartphone for Iphone or Android (its possible that this app is blocked in China). After installing and registering it on your Phone, you can start linking the Signal-Desktop app: Settings -> Linked devices -> Add, and then take a picture of the QR code which will be shown in the installation wizard on your desktop (see picture above). Signal is now registered and will work on your desktop with nwjs and on your phone.

To trigger the bug, close nwjs and Signal and start it again. Normally you should only see the chat window, like this:
2017-02-23-163821_swaygrab
But instead, nwjs triggers a bug where the setup window of Signal always restarts, see:
2017-02-23-163835_swaygrab
Somehow nwjs is unable to store the information that the setup of Signal has already took place, whereas the rest of the session data like chat log etc. is getting saved and remembered (config folder is ~/.config/Signal Private Messenger).

Thank you for your support and best regards,
Jonas

@xzhan96
Copy link
Contributor

xzhan96 commented Feb 24, 2017

@onny thanks for your very clear description.
One more question, is any previous nwjs version works fine ever before?

@onny
Copy link
Author

onny commented Feb 24, 2017

@xzhan96 I'm using Signal app since nwjs version 0.16.1 and the bug was already present. I'm not aware of any nwjs version which doesn't have this bug.

@xzhan96 xzhan96 removed the needinfo label Feb 27, 2017
@xzhan96
Copy link
Contributor

xzhan96 commented Mar 8, 2017

@onny if the issue also appear when Signal as Chrome App ?

@xzhan96
Copy link
Contributor

xzhan96 commented Mar 8, 2017

#5295

@onny
Copy link
Author

onny commented Mar 8, 2017

@xzhan96 No, in chrome/chromium everything works fine

@onny
Copy link
Author

onny commented Mar 11, 2017

Bug still present using the latest versions:

nwjs-bin 0.21.1-1
signal 0.33.0-1

@onny
Copy link
Author

onny commented Mar 11, 2017

I've created a patch for the signal app so that it will close the installer window after starting:
https://aur.archlinux.org/cgit/aur.git/tree/installer-window.patch?h=signal
It's a dirty workaround, found here diracdeltas/Signal-Desktop@02c5dbf

@rogerwang rogerwang self-assigned this Mar 14, 2017
@xzhan96
Copy link
Contributor

xzhan96 commented Mar 14, 2017

@onny I change the below code in chromium.js

    if (chrome.runtime.onInstalled) {
        chrome.runtime.onInstalled.addListener(function(options) {
            if (options.reason === 'install') {
                extension.install();
            }
        });
    }

to

    if (chrome.runtime.onStartup) {
        chrome.runtime.onStartup.addListener(function(options) {
            if (options.reason === 'install') {
                extension.install();
            }
        });
    }

And then it works fine, that means the setup wizard only appears on first start up after Signal is installed. I am not sure this is correct, but from the google's document , I think onStartup is proper for your case?

@rogerwang
Copy link
Member

@xzhan96 changing it to onStartup is not a proper fix. And the callback of the onStartup event has no arguments ...

@xzhan96
Copy link
Contributor

xzhan96 commented Mar 14, 2017

@rogerwang got it. sorry, I just see your are investigating this issue.

@rogerwang
Copy link
Member

The root cause is that onInstalled is sent on every time app starts. Will push a fix soon.

@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

@xzhan96
Copy link
Contributor

xzhan96 commented Mar 14, 2017

@rogerwang could you link the patch?

@rogerwang
Copy link
Member

it's merged in the master patch in chromium repo.

@rogerwang
Copy link
Member

I just modified RuntimeAPI::OnExtensionLoaded(), if you are interested.

@xzhan96
Copy link
Contributor

xzhan96 commented Mar 14, 2017

nice, thanks a lot.

@onny
Copy link
Author

onny commented Mar 16, 2017

Thanks, this issue is fixed in the latest nightly 👍

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

No branches or pull requests

4 participants