Anyone else get this Skype/Electron issue?

For probably a year or two I’ve had this annoying issue with skypeforlinux-bin where sometimes when it’s running in the system tray and I launch it again, instead of opening the existing running instance it will start a new instance of Skype.

I’ve never been able to find any reports of this issue, but after many months of trying different things to fix it I eventually found that it’s because the Electron SingletonCookie file under /tmp/scoped_dirXXXXXX/ was randomly disappearing.

To work around this I wrote a launch script for Skype to restore the cookie file if it’s been deleted:

#!/bin/sh

SKYPE_DIR="$HOME/.config/skypeforlinux"

if pidof -q skypeforlinux && [ -e "$SKYPE_DIR/SingletonSocket" ]; then
	SOCKET_DIR=`dirname $(readlink "$SKYPE_DIR/SingletonSocket")`

    if [ ! -L "$SOCKET_DIR/SingletonCookie" ]; then
		cp -P "$SKYPE_DIR/SingletonCookie" $SOCKET_DIR
		echo "Restored $SOCKET_DIR/SingletonCookie"
	fi
fi

exec /usr/bin/skypeforlinux $@

It works perfectly. But the cause of this issue is still a mystery to me.

  • Is this a Skype-only issue or does it happen with other single-instance Electron apps?
  • Is something else on my system deleting this SingletonCookie file because it looks like a broken symlink?
  • Why aren’t more people experiencing and reporting this issue?
  • Why does the flatpak version of Skype not have this issue?

So many unanswered questions…

If anyone feels like doing some digging, here’s my system info: https://0x0.st/X3Bc.txt

I’ve been using Skype for years and have never had this issue.

The only issue I have is that it sometimes kills my tint2 panel when launched, but Steam does this too. They are both inconsistent and infrequent, so I ignore the issue, but nothing like you are experiencing.

Then again, I can probably count on one hand how many times I’ve launched Skype when it’s already running. I know I did it recently, though — like last week.

Anyway, thanks for the fix to a potential issue. :vulcan_salute: :enos_flag:

And here I was thinking EOS users are probably just too cool to be using an ancient program like Skype :smile:

I have Skype pinned to my KDE “taskbar” so that’s my primary way if opening it, which I do many times a day. It opens Skype instantly and doesn’t require two clicks like the system tray icon (menu > open).

I also have a keyboard shortcut for Skype which would result in the same issue since it just launches it. Only opening it from the system tray icon or a notification would avoid the issue because that doesn’t actually launch the program again, it just shows the window.

Well, you were kinda right. I only have this thing installed because I need it for work. :sweat_smile:

As for the launching issue, it seems the “fix” is to try to remember if it’s already open or to use the tray icon instead. :wink:

1 Like