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

Emote occasionally missing user object in WebSockets #7235

Closed
1 task done
Nerixyz opened this issue Jan 2, 2025 · 4 comments
Closed
1 task done

Emote occasionally missing user object in WebSockets #7235

Nerixyz opened this issue Jan 2, 2025 · 4 comments
Labels

Comments

@Nerixyz
Copy link

Nerixyz commented Jan 2, 2025

Describe the bug

Sometimes, and I don't know when exactly, the Emote sent in the emote_create event is missing the user object, even though it should be present. This was initially reported as Chatterino/chatterino2#5781 and "fixed" in Chatterino/chatterino2#5783 by falling back to the undocumented channel.
For me, the bug only happened once and further emote additions would include the user (even for the same emote). Further emote additions will all include the user.

Steps to reproduce

  1. Open WebSocket connection (be lucky to land on one that hasn't resolved a user yet)
  2. Join a channel
  3. Add an emote in that channel
  4. Observe emote_create where the user is missing in the emote object
  5. (optional): Remove the emote and add it again
  6. (optional): Observe emote_create where the user is present

Expected behavior

The user should be present in the payload.

Screenshots

-

Device information

-

BetterTTV Version

-

Additional information

The extension should also have this bug, because it also uses the user of the emote (...and falls back to the current channel):

socketClient.on(EventNames.EMOTE_CREATE, ({channel, emote}) => {
if (!validChannelDestination(channel)) {
return;
}
this.emotes.set(emote.code, createEmote(emote.id, emote.code, emote.animated, emote.user));

Version Check

  • I have checked that I'm using the newest version of BetterTTV available.
@Nerixyz Nerixyz added the bug label Jan 2, 2025
@night
Copy link
Owner

night commented Jan 2, 2025

channel is a deprecated field since the websocket server doesn't support versioning at this time. ideally folks do not rely on that field any longer.

it actually shouldn't be possible for you to receive an emote_create without user as the outgoing transform operation for this message is:

serializedEmote.channel = serializedEmote.user.name

upon testing the reported emote, the extension seems to receive user on the emote_create too.

are you certain this isn't some sort of bug in chatterino? maybe there's a create -> update, which is unsetting the user info?

@Nerixyz
Copy link
Author

Nerixyz commented Jan 2, 2025

are you certain this isn't some sort of bug in chatterino? maybe there's a create -> update, which is unsetting the user info?

When debugging, I made a breakpoint here - at that point, only the JSON was parsed. But as I said, I couldn't reproduce it afterward.

@night
Copy link
Owner

night commented Jan 2, 2025

Right, but I don't see how that would be technically possible given the code on our end. If we were to serialize an emote without a user, the message send itself would encounter an exception before that message is sent. The emote in the message must have user to receive channel.

@night
Copy link
Owner

night commented Jan 27, 2025

Closing this due to inactivity, but if you do find steps to reproduce this please let us know!

@night night closed this as completed Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants