cyyynthia / pronoundb.org

A browser extension that lets people know how to refer to each other on various places of the Internet. Available on Chrome, Firefox, and Edge.
https://pronoundb.org
BSD 3-Clause "New" or "Revised" License
271 stars 22 forks source link

PronounDB breaks Twitch Chat when 7TV is enabled. #98

Closed nVixor closed 1 year ago

nVixor commented 1 year ago

Title says it all, I don't know what to put here other than the error I was getting: opera_SPPK48JRNf If you have further questions, just ask and I'll try to help.

nVixor commented 1 year ago

Oh yeah, if it's more convenient, I also joined the discord server linked in the Github Readme so you can message me there!! smooshie#4915

cyyynthia commented 1 year ago

How severe is the issue? Does it happen consistently all the time, or is it triggered by something specific (e.g. subscribers notifications, channel rewards, ...)

7tv have an overly aggressive way to inject into Twitch which tends to cause a lot of issues with other tools. I'll try to make my 7tv-specific injection more fault tolerant, so next time it doesn't break as badly...

nVixor commented 1 year ago

It's pretty consistent. The time it takes to crash can vary from instantly to 30 minutes. My leading theory is that when someone who has their pronouns set sends a message, that is when it breaks. And yeah, 7TV got an update like, very recently so that very well could be the cause of the issue.

nVixor commented 1 year ago

The other twitch chat pronoun extension (Alejo's) just simply doesn't work w/ 7TV installed.

cyyynthia commented 1 year ago

It's unlikely to be the cause; the part of code that seems to fail is ran for every message and is used to extract the user who sent a given message (since 7tv holds all of the data in private stores, the message received event is my only chance at mapping message ids to a user id)

I'm p sure it's failing on a very specific type of message who doesn't have a user id attached to it, or is formatted differently. Anonymous sub gifts? Raids?

Either way, a naive fix is easy and could be done in 3 minutes, but I'm in my bed right now and can't publish an extension update from here 😅

It should be fixed by tomorrow (and by next week for Edge because Microsoft extension reviews are looooooooong)

nVixor commented 1 year ago

Awesome!! ty :DDDD

cyyynthia commented 1 year ago

For the reference, this method is where the problem resides according to the stack trace you've shown.

https://github.com/cyyynthia/pronoundb.org/blob/e9a03c56f282a2b0f175575e9556661fd5017ea5/packages/extension/src/inject/twitch.ts#L48-L59

nVixor commented 1 year ago

alright, might forward this to the 7TV devs if they ask for it so ty for that :3 (i have no idea what it means, i just came here to report a bug)

cyyynthia commented 1 year ago

7tv devs are unlikely to care and will probably answer with a hostile "dont run multiple extensions at the same time" :)

7tv devs don't really have a good track of being friendly and caring about others. I'll just fix it in my extension and it'll no longer cause crashes.

AnatoleAM commented 1 year ago

7tv have an overly aggressive way to inject into Twitch which tends to cause a lot of issues with other tools

To be clear, it's not more aggressive than any of the other major general twitch extensions, however what you're looking at is a chatbox written in a different framework. Whereas React (at least older versions of it) expose relevant component information, Vue 3 holds everything in closures, which are impossible to access reliably with external code.

Regardless, there is a plugins API being designed, which will expose many methods to interact with the chat reliably. Cross-compatibility with FrankerFaceZ addons will also be considered.

In the meantime feel free to make a pull request via SevenTV/Extension, you might able to expose what you need until the plugins API is ready.