EionRobb / purple-discord

A libpurple/Pidgin plugin for Discord
GNU General Public License v3.0
379 stars 43 forks source link

empty and missing messages #328

Closed sebbu2 closed 3 years ago

sebbu2 commented 3 years ago

Since yesterday, i see empty EDIT, some EDIT with (null) messages, and there's some i don't even see at all. Most messages from others (if not all of them, i'm not sure), i don't see at all. It makes the plugin not work at all, all i'm able to see are my own message and empty EDIT: lines.

chainria commented 3 years ago

Yeah same for me as well. I can only see my messages. Guess Discord changed something again. Can gladly provide debug logs if told what exactly to do. Hope this issue gets resolved quickly, since it completely breaks the plugin for me.

Schmaiffe commented 3 years ago

Yeah, whatever Discord changed completely broke the plugin for me too, I can see when people are online and I can send messages, but no messages sent to me get through. I primarily use it for DMs, so I haven't tested it in channels, but DMs to me don't work at all.

Penaz91 commented 3 years ago

From a quick, late-night look at the debug logs, it seems the MESSAGE_CREATE events are captured by the plugin, but the "content" is always an empty string. Hope this helps.

chainria commented 3 years ago

I primarily use it for DMs, so I haven't tested it in channels, but DMs to me don't work at all.

Welp, that rung my alarm bells. I ACTUALLY missed a lot of channel messages. But I can also pinpoint a quite exact time and date now, since I have a few very busy channels.

Last message in the channels was at 2021-04-29 21:18:13 MEST (GMT+2). Hope this helps. No messages after this date are visible in the logs.

EDIT: Yes, I have confirmed it with a channel. Exactly the same behaviour. No messages from others, just my own ones. And empty "EDIT:" messages.

EionRobb commented 3 years ago

Sorry for the missing messages.

Can I just confirm whether anyone is having this issue with the very latest commits from master branch or if they're using a version that their distro is packaging?

TearOfTheStar commented 3 years ago

Using latest nightly on win10, same problem, I can send messages thru pidgin, but can't receive any.

EionRobb commented 3 years ago

Thanks for that. I thought I'd committed something recently that might have helped already but I thinkin got myself confused with the v8 api changes I've been working on instead

chainria commented 3 years ago

I am using a fairly new git version, from 2020-08-12. That should be @8fd7ceb89ea1f989f3a10569b218418e22c838ec. Didn't see the need to update so far. But I can update right now, no problem! Using a live ebuild so every reinstall pulls the newest commit.

EionRobb commented 3 years ago

libdiscord.zip Can windows users try with this?

It looks like the cause is Discord doing another round of blocking "self bots", so rather than identify ourselves as "Pidgin" in the handshake with the discord servers, I'm telling them that we're a web browser, which seems to maybe have the desired effect. Maybe.

EionRobb commented 3 years ago

(If you're compiling yourself, https://github.com/EionRobb/purple-discord/commit/02c88dbf8eb1bc9e3822149199e5149a2df08625 might be the commit that maybe fixes it)

kecky commented 3 years ago

I'm on windows and still run into this even with the newest nightly build. :(

alexolog commented 3 years ago

I am on Windows as well and haven't been affected. Maybe it's a gradual rollout? I don't think the DLL includes version information, does it?

OrderlyUnicode commented 3 years ago

It seems to not just be a Windows issue. I'm having the same problem with a fresh install on Arch. Edit: Evidently, the version in the AUR is slightly out of date, so I'm going to try compiling it directly and see if that works.

Edit 2: Disregard all of this. compiling it myself fixed the issue for me.

EionRobb commented 3 years ago

Thanks for confirming the fix, @OrderlyUnicode :)

alexolog commented 3 years ago

So the new Windows DLL is good to install?

kecky commented 3 years ago

Still got the same issue even with the new build, sadly.

chainria commented 3 years ago

Still got the same issue even with the new build, sadly.

Updated to 0.9.2021.05.01.git.beb44e8. Problem persists. However, now additionally not even a window pops up if I DM someone in Discord. And my messages are missing as well now. So basically, it's worse now :/

chainria commented 3 years ago

I am on Windows as well and haven't been affected. Maybe it's a gradual rollout? I don't think the DLL includes version information, does it?

I took a look at the library and DID find version information. So I dug a little bit. You can find your version information under Help > About Plugins. The order seems quite random, I have to scroll to the lower third of the list. Hope this helps!

chainria commented 3 years ago

It seems to not just be a Windows issue. I'm having the same problem with a fresh install on Arch. Edit: Evidently, the version in the AUR is slightly out of date, so I'm going to try compiling it directly and see if that works.

Edit 2: Disregard all of this. compiling it myself fixed the issue for me.

Which version did you build? Since for me, everything got worse :P

OrderlyUnicode commented 3 years ago

Which version did you build? Since for me, everything got worse :P

I installed it after the commit that was mentioned in a comment above. There's apparently been more commits since then, so maybe there was a regression?

chainria commented 3 years ago

Which version did you build? Since for me, everything got worse :P

I installed it after the commit that was mentioned in a comment above. There's apparently been more commits since then, so maybe there was a regression?

Thanks. Yeah, maybe. But not getting anything still looks better in the logs than only talking to myself. Actually, I might discard those later. So since it's completely broken now, I am open to any tests of upcoming commits :D

EionRobb commented 3 years ago

Ok, 5 more commits to make it more reliable. Turns out there's a few more protocol changes during the initial handshake (I guess to reduce network traffic, although not by much since it's compressed anyway)

If self-compiling people can test with https://github.com/EionRobb/purple-discord/commit/c8be504eddf4523f814b6f9329f87bc4358fc9f6 and windows people with libdiscord.zip that would be fantastic

chainria commented 3 years ago

If self-compiling people can test with c8be504 and windows people with libdiscord.zip that would be fantastic

Man... did they rewrite half of their protocol? Thanks for your fast help!

I can confirm 0.9.2021.05.01.git.c8be504 compiled under Gentoo working. DMing works, incoming and outgoing are shown and correctly transmitted between the two clients. So it doesn't matter where I respond, it works. Thank you!

EDIT: Just got an incoming message from a channel. Works as intended. Everything seems back to normal, even with the occassional not cleared unread tag in Discord. Nice work! Thank you, once more. Now I can put Discord away to minimized and only use it when absolutely needed :)

TearOfTheStar commented 3 years ago

Yep, W10, working normally. Thank you!

Schmaiffe commented 3 years ago

Hi, sorry for late reply, I was also on Windows 10, and was at first using an old dll because I'm one of those problem users who doesn't update unless something is broken, then I tried the newest one (before my first comment) to see if that would fix it, but Discord's change was too new so no dice. Tried the dll in the zip and it works! I'm getting my DMs again, thank you.

Tirus42 commented 3 years ago

I can also confirm that its works again. Tested under Debian Buster with the repo provided pidgin/libpurple version and the latest commit here (self build).

Thank you for your fast reaction and solution!

alexolog commented 3 years ago

I am on Windows as well and haven't been affected. Maybe it's a gradual rollout? I don't think the DLL includes version information, does it?

I took a look at the library and DID find version information. So I dug a little bit. You can find your version information under Help > About Plugins. The order seems quite random, I have to scroll to the lower third of the list. Hope this helps!

Thank you!

I am running: Version: 0.9.2020.05.12.git.r672+.a791f12a4c73+

Seems to work still.

I will check the new zip in a moment

alexolog commented 3 years ago

I will check the new zip in a moment

Seems to be working, but then the old one also worked for me

LurkerHub commented 3 years ago

Interestingly, the new version gets different JSON structures from Discord.

Specifically: The old "t":"READY" JSON had components that do not exist in the new one: "presences" and "notes" The new one has 2 components that did not exist in the old: "users" and "merged_members", as well as a new, separate "t":"READY_SUPPLEMENTAL" JSON.

In particular, the user's roles have moved from d/guilds/members/roles to d/merged_members/roles, which breaks the calculation of permissions. I wonder if that could have caused #331

Penaz91 commented 3 years ago

Seems that c8be504 solved the issue for me, I'm available for more tests if needed

sebbu2 commented 3 years ago

It also solved the issue for me.

alexolog commented 3 years ago

Let's not close the issue until there's a working Windows DLL that implements the fix. Not everybody compiles from source.

Schmaiffe commented 3 years ago

FWIW I didn't compile from source, I used the Windows DLL linked above, and it worked for me. I also just had someone test an edit with me (in a DM) and that worked too.

EionRobb commented 3 years ago

The nightly dll at https://eion.robbmob.com/libdiscord.dll has been updated with the changes mentioned in this issue