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

Does not work with snap version of eclipse #74

Open
5HT2 opened this issue Oct 3, 2019 · 22 comments
Open

Does not work with snap version of eclipse #74

5HT2 opened this issue Oct 3, 2019 · 22 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed third-party The issue or pull-request is related to a third-party library used in the project

Comments

@5HT2
Copy link

5HT2 commented Oct 3, 2019

Bug description

Does not work with snap version of eclipse. Tried my own API key, along with adding eclipse manually. Doesn't show the rich presence

Expected behavior

It works

How to reproduce

Steps to reproduce the behavior:

  1. Open Eclipse
  2. Check Discord
  3. Witness the error

Additional context

  • Plug-in version: 1.1.1 (didn't work in earlier versions either)
  • Eclipse IDE version: 2019-03 (4.11.0)
@5HT2 5HT2 added the bug Something isn't working label Oct 3, 2019
@echebbi
Copy link
Owner

echebbi commented Oct 3, 2019

I just tested the plug-in on the 2019-03 package for Java developers and it works as expected on my side. A few questions to investigate the issue:

  1. When you say that it doesn't show the rich presence, do you mean that Discord shows nothing at all, not even the following?
  1. By "adding Eclipse manually", you mean that you registered Eclipse IDE in Discord through User Settings > Game Activity as specified in the documentation?

  2. Could you check Eclipse's Error Log view (Window > Show View > Error Log) and tell me whether you find a log that seems related to the plug-in?

  3. Could you check that the plug-in is activated on startup?

    • Window > Preferences > General > Startup and Shutdown
    • Discord Rich Presence for Eclipse IDE should be checked:
  1. You specified "snap version", I will assume you refer to an Eclipse IDE installed through snapcraft. As I work on Windows I cannot test it right now; did you try with an Eclipse package installed from the official website?

  2. You said that the plug-in wasn't working earlier, so you tried the 1.0.3 release?

@Komposten
Copy link

Komposten commented Oct 3, 2019

Can confirm on Zorin OS 15 (based on Ubuntu 18.04) with Eclipse 2019-03 (latest stable snap release) and Discord Rich Presence 1.0.3.

To respond to the 6 points above:

  1. Eclipse shows up like this:
    image
  2. I added eclipse manually to Discord using Settings > Game Activity.
  3. No logs related to the plug-in at first glance. Some errors in org.eclipse.ui, org.eclipse.jdt and sonarlint.
  4. Discord Rich Presence is checked in Startup and Shutdown. I've also double-checked that it's enabled for the open project.
  5. I'm using the version from snapcraft. Haven't tested another one (yet).

@5HT2
Copy link
Author

5HT2 commented Oct 3, 2019

  1. Eclipse shows up with a lowercase e, like @Komposten showed.
    Screenshot_20191003_113444

  2. Yes, and I also tried without

  3. Nothing of relevance.
    Screenshot_20191003_113719
    eclipse.log

  4. Screenshot_20191003_114023

  5. I installed eclipse with snap install eclipse --classic
    I am unable to build the dependencies to install this with the official website, but I can try later as long as I figure out how to keep all my settings and stuff.

  6. Yes

@Komposten
Copy link

Komposten commented Oct 3, 2019

I just tried installing Eclipse for Java Developers 2019-09 from the website and run that with Discord Rich Presence 1.1.0. Still having the same issue.

About adding Eclipse manually to Discord, I actually have two options:

  • eclipse: Maps to the Eclipse executable (currently /home/komposten/Desktop/eclipse/eclipse for the 2019-09 test install).
    If I run Eclipse from the terminal this may have a different name (e.g. ./eclipse instead).
  • Eclipse - [current file name] - Eclipse IDE: Maps to the Java executable (/usr/bin/java).

If I add either of those to Discord it will simply show the name and the uptime. No icon or anything like that, just like in my previous screenshot.
If I don't add either of them manually, Discord shows nothing.

@echebbi
Copy link
Owner

echebbi commented Oct 3, 2019

Thank you both for your time. By default when Discord doesn't know the application it shows the name of the executable; that also means that it receives no message from my plug-in.

At this point I have two hypothesis:

  • either there is a bug in my code, in which case I should be able to fix it quickly,
  • or the library I use to communicate with Discord does not support your OS, in which case I don't know if I will be able to fix the issue.

I'm going to run some tests in a VM and I'll keep you updated.

@S-B99 could you tell me which OS you are using?

@5HT2
Copy link
Author

5HT2 commented Oct 3, 2019

I am running KDE Neon 5.16

Operating System: KDE neon 5.16
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.3
Kernel Version: 5.0.0-29-generic
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6300HQ CPU @ 2.30GHz
Memory: 7.6 GiB of RAM

@echebbi
Copy link
Owner

echebbi commented Oct 3, 2019

Linux is indeed supported but issues have already been reported on some distributions. #39 reported an issue on Ubuntu 18.04.

I know that under the hood the library embeds platform-specific binaries of the Discord SDK (see discord-rpc-release) and they might not work as expected on some distributions.

@echebbi echebbi added the investigation The origin of the issue is not determined yet label Oct 3, 2019
@echebbi
Copy link
Owner

echebbi commented Oct 3, 2019

I managed to reproduce the issue on a Zorin OS 15 VM; I'll debug it tomorrow.

@echebbi echebbi self-assigned this Oct 3, 2019
@echebbi
Copy link
Owner

echebbi commented Oct 4, 2019

I did some research, and sadly it seems that Discord RPC does not behave well with snap, see: discord/discord-rpc#213 (comment)

I can confirm that the plug-in works as expected on Zorin OS 15 when both Discord and Eclipse IDE are installed manually.

It looks like some people managed to fix the issue by adapting some paths but that looks pretty low level so I don't know whether it's possible for me to do it. I'll see what I can do.

@echebbi echebbi added third-party The issue or pull-request is related to a third-party library used in the project and removed investigation The origin of the issue is not determined yet labels Oct 4, 2019
@Komposten
Copy link

I may have Discord installed through snap, which could explain why it didn't work even with a manually installed Eclipse. Will double-check this later.

@5HT2
Copy link
Author

5HT2 commented Oct 4, 2019

What do you mean by manually with snap? And it doesn't work on KDE Neon 5.16
Oh I actually reacted to that issue before, I guess it slipped my mind. Thank you!

This seems to be it

@echebbi
Copy link
Owner

echebbi commented Oct 4, 2019

What do you mean by manually with snap?

My bad, I meant "when both Discord and Eclipse IDE are installed manually". I fixed the typo.

@S-B99 could you try to install the software manually to check whether it works? You said previously that you had to "build the dependencies to install from the official website"; I am not used to KDE Neon but since it's based on Ubuntu can't you download the official Linux package?

This seems to be it

Yes, this solution looks interesting but seems to be relevant for users of the Discord VS Code plug-in only. It works for this plug-in because the author(s) — as far as I can see — ported the Discord RichPresence SDK to JavaScript. As they rewrite it they have full control on how they send information to the Discord application.

For my part, I rely on java-discord-rpc which binds the official Discord SDK to a Java API. In other words, we do not have any control on how information are sent to the Discord application. As a result, I don't think that this solution is applicable here.

@5HT2
Copy link
Author

5HT2 commented Oct 4, 2019

Oh alright.
The official linux packages should work now, I fixed JDK last night.
That's unfortunate. I'll try the non snap Eclipse package. My discord is using the deb. Also, Zorin seems to be based on Ubuntu along with KDE Neon

@5HT2
Copy link
Author

5HT2 commented Oct 15, 2019

Leaving this here so someone can pin it on me for not replying tomorrow. Sorry, I've been busy outside the country the past week.

@5HT2
Copy link
Author

5HT2 commented Oct 16, 2019

"Installed" the full eclipse version, it works, thanks.
So this is a containering bug.

@5HT2
Copy link
Author

5HT2 commented Oct 21, 2019

Any word on getting this to work with snap?

@echebbi
Copy link
Owner

echebbi commented Oct 25, 2019

Hi, sorry for not answering earlier: I was not at home past week.

In order to fix the issue I need a Java implementation of Discord SDK and the only one I found is neither mature nor maintained. I however cannot afford the time to update the library so, since an alternative is available (i.e. installing both Eclipse IDE and Discord by hand) I do not plan to work on this soon.

I am deeply sorry about that; anyone willing to help is of course more than welcome to take over the library so that I can use it in the plug-in.

@echebbi echebbi added the help wanted Extra attention is needed label Oct 25, 2019
@5HT2
Copy link
Author

5HT2 commented Oct 25, 2019

That's alright, thanks for your reply!

Thanks for making this, it works great as long as you're not using snaps

@InfRandomness
Copy link

InfRandomness commented Sep 4, 2020

Hello there, I already had to deal with snapcraft and flatpak and I figured I'd share my experience.

The issue here is that those two softwares make a sandbox around discord or eclipse, the problem is that in the end eclipse might not found the socket file to connect to send informations to,

I already found a workaround for flatpak which is simply to make a symlink from $XDG_RUNTIME_DIR/app/com.discordapp.Discord/discord-ipc-0 to $XDG_RUNTIME_DIR. Meanwhile that work, eclipse have to be installed without using flatpak nor snapcraft 🙄.

as for snapcraft, I have no idea, I have found multiple issues with workarounds but they all don't work.

@Gamebuster19901
Copy link

Just a note for others: This also does not work on the snap version of discord.

You must install both Eclipse and Discord outside of snap.

@InfRandomness
Copy link

You'd need to have the discord socket file in $XDG_RUNTIME_DIR for it to work on an Unix system, that's how discord-rpc was made https://github.com/discord/discord-rpc/blob/master/src/connection_unix.cpp#L52-L77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed third-party The issue or pull-request is related to a third-party library used in the project
Projects
None yet
Development

No branches or pull requests

5 participants