timche / gmail-desktop

:postbox: Nifty Gmail desktop app for macOS, Linux & Windows
MIT License
832 stars 91 forks source link

Starting `gmail-desktop` multiple times results in multiple instances running (instead of opening an existing one) #194

Closed cipriancraciun closed 3 years ago

cipriancraciun commented 4 years ago

Steps to Reproduce:

  1. run gmail-desktop once, it opens a window;
  2. minimize that window to system tray;
  3. run gmail-desktop again, it opens a window;
  4. repeat from step 2 a couple of times;
  5. check the running processes, and now we have multiple gmail-dekstop instances running minimized at the same time;

This is somewhat serious, because one instance eats quite some RAM, and having multiple gmail-desktop instances becomes quite heavy on the system.

I'm also wondering if all these instances are prepared to share the internal cache folders and won't clobber each-other...

I haven't observed this behaviour in previous versions.

timche commented 4 years ago

That might be related to 01cabf9cdb71d7e3761514bffbf71f2e51a6cd10 that has upgraded Electron to another major version. We will look into that, thanks.

cipriancraciun commented 4 years ago

Any updates on this?

It's kind of really blocker, as I have to clean the processes at least 3-4 times a day when my RAM gets full and Linux starts swapping heavily...

(BTW, if you release beta versions more often, people can try and see if various bugs are present / solved.) :)

timche commented 4 years ago

Ah, sorry man. Didn't have time yet to look into that. I'll check if I can spend some time on the weekend.

timche commented 4 years ago

I've released v2.20.1 which upgrades Electron to v9. I hope this will fix this your issue, because I couldn't find anything in the app code that could cause it and we haven't changed anything regarding instance handling for a long time whereas Electron did actually.

cipriancraciun commented 4 years ago

I've just updated to 0.20.1, and after using it for a couple of days I'll report back.

(I've tried reproducing the issue with the new version, but failed. Although even with the previous version it happened perhaps only once in 10 tries. So we'll see...)

cipriancraciun commented 4 years ago

Unfortunately the issue is still present, and I do get multiple gmail-desktop instances running...

@timche please re-open this issue.

timche commented 4 years ago

It's very difficult to say what the error could be without reproducing it 100%. Would appreciate some experimentations and observations. My current guess is that the first instance somehow freezes and so the second instance doesn't know about another instance so this condition will be executed: https://github.com/timche/gmail-desktop/blob/master/src/app.ts#L52-L54

cipriancraciun commented 4 years ago

I completely agree it's a very strange issue as it can't be easily reproduced.

How could I do the following:

timche commented 3 years ago

We've released a new version few days ago where we've upgraded Electron to the latest version. Are you still experiencing this issue? If not, we can close it.

timche commented 3 years ago

I'm closing this issue for now. Let me know if this issue still persists and we can re-open it.