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

Should the client reconnect when the auth token is updated? #5929

Open
Tracked by #5908
pajlada opened this issue Feb 7, 2025 · 3 comments
Open
Tracked by #5908

Should the client reconnect when the auth token is updated? #5929

pajlada opened this issue Feb 7, 2025 · 3 comments

Comments

@pajlada
Copy link
Member

pajlada commented Feb 7, 2025

No description provided.

@iProdigy
Copy link
Contributor

iProdigy commented Feb 7, 2025

answer: only if the account switched or new scopes were added (that allow for creating a missing subscription type)

even if token expires, the websocket is not killed & refreshing the token doesn't kill the websocket either - token only has to be valid at the time the helix calls are made that establish the eventsub subscriptions

if we're concerned about the edge case where user revokes the auth connection & reauths, we would already know the subscriptions were dead via https://dev.twitch.tv/docs/eventsub/handling-websocket-events/#revocation-message

@pajlada
Copy link
Member Author

pajlada commented Feb 7, 2025

Given the lifetime of a client, I don't think we need to handle this then.

Do you think there's a scenario where we should try to handle the revocation message?
I see 3 revocations in the docs:

  • One of the users that's part of the subscription no longer exists (e.g. if channel we were joined to is banned)
    I don't think we want the messages anymore anyway then
  • Subscription no longer supported
    Nothing we can do to recover in this case
  • The user authorization is revoked
    If the user changes their password or disconnects from the Chatterino client ID, do we need to do anything?

@iProdigy
Copy link
Contributor

iProdigy commented Feb 7, 2025

i haven't closely looked at the c2 impl, but on revocation, we should free any internal state/memory associated with the sub, but no need to make any helix requests to clean up the sub

if post cleanup there's zero topics subscribed, theoretically we could disconnect the socket - but ppl may later add other channels so no need

on version_removed, we could try to resub with an incremented version number since the updated payload is prolly similar enough to still work, but not necessary

in short: yeah we're fine to just ignore them for now

tho we could use auth revoked on whispers topic to tell the user to reauth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants