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

app.makeSingleInstance doesn't work under linux, Electron 1.7.x #9880

Closed
astoilkov opened this issue Jun 27, 2017 · 8 comments
Closed

app.makeSingleInstance doesn't work under linux, Electron 1.7.x #9880

astoilkov opened this issue Jun 27, 2017 · 8 comments

Comments

@astoilkov
Copy link
Contributor

  • Electron version: 1.7.x
  • Operating system: Linux

Works in 1.6.11.

Expected behavior

app.makeSingleInstance callback is called when opening an associated file from file manager and application is already opened

Actual behavior

app.makeSingleInstance callback is delayed with about 30-60 seconds before being called

How to reproduce

You could reproduce the problem by downloading Caret 3.0 .deb and then following the steps described here.

The issue stops reproducing when releasing the same code with 1.6.11.

@Thomas101
Copy link
Contributor

We're seeing exactly the same issue here wavebox/waveboxapp#284

@Thomas101
Copy link
Contributor

I've just added a super simple example into git demonstrating the bug...

git clone https://github.com/wavebox/electron-quick-start.git
cd electron-quick-start
git checkout singleinstance-bug
npm install
npm start

Then in a new terminal....

npm start

@astoilkov
Copy link
Contributor Author

@Thomas101 Thanks a lot for helping out with a simple example.

@enlight
Copy link
Contributor

enlight commented Aug 1, 2017

May be related to #9965 and #9576.

@mattridley
Copy link

I am seeing the same thing in macOS. Is there a separate issue tracking that or do the labels and title of this just need updating?

@Thomas101
Copy link
Contributor

@mattridley we're not seeing it with macOS or Windows only linux. Which version of electron did you see it with? Do you see the problem if you try it with the electron-quick-start above? #9880 (comment)

@mattridley
Copy link

I saw it with 1.7.5 (reverting back to 1.6.11 fixes the issue). I also have the problem with the quick start (see https://youtu.be/CNFhWWF77Ms)

MarshallOfSound added a commit that referenced this issue Sep 14, 2017
Wait for the IO thread to be a thing before attempting to listen on the socket

Fixes #9880
zcbenz pushed a commit that referenced this issue Sep 20, 2017
Wait for the IO thread to be a thing before attempting to listen on the socket

Fixes #9880
MarshallOfSound added a commit that referenced this issue Sep 23, 2017
Wait for the IO thread to be a thing before attempting to listen on the socket

Fixes #9880
jkleinsc pushed a commit that referenced this issue Sep 23, 2017
* Fix app.makeSingleInstance hanging on posix systems

Wait for the IO thread to be a thing before attempting to listen on the socket

Fixes #9880

* Move OnBrowserReady call to PreMainMessageLoopRun to account for timing issues on macOS

* Woops, how did that happen ;)

* Refactor as per @zcbenz comments

Also fix issue where we run the single instance callback *not* on the UI thread,
this apparently results in a hung process.

* Appease the linting gods

* Create watcher when message loop is ready

* spec: Add test case for app.makeSingleInstance

* Fix missing extension when saving a file without filters

Previously, when triggering the save dialog through e.g. `<a download>`
links (e.g. http://jsfiddle.net/koldev/cW7W5/), the extension was only
saved if Finder was set to show all extensions by default. We now always
display the extension to make sure that it is saved.

If we want to keep the extension hidden, we could also populate the
allowed file types array with the extension from the default filename,
but that would have interfered with how we set the filters.

* Try to make test less flaky

* Try simpler test

* Fix stdout detection

* Try longer timeout on test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants