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

Time Out User #183

Open
manfe opened this issue Oct 23, 2024 · 3 comments
Open

Time Out User #183

manfe opened this issue Oct 23, 2024 · 3 comments

Comments

@manfe
Copy link

manfe commented Oct 23, 2024

@piotr-suwala

I am having issues on how to listen to user being timed out.

BTW: our time out is being set on custom fields, and when updating the custom fields, no events are fired to the streamUpdates

I am trying to listen for user streamUpdates but this is not receiving anything related to this.

useEffect(() => {
    if (!chat?.currentUser) return

    setCurrentUser(chat.currentUser)

    // Subscribe to user updates
    console.debug("Subscribing to user updates")
    const disconnect = chat.currentUser.streamUpdates((user) => {
      console.debug("User updated", user)
      setCurrentUser(user)
    })

    return () => {
      console.debug("Unsubscribing from user updates")
      disconnect()
    }

  }, [chat?.currentUser])
@manfe
Copy link
Author

manfe commented Oct 24, 2024

I debug a bit more this and find some weird behaviors:

Our Access Manager didn't have permission to leave the channel, so was returning 403 and when trying to disconnect it was returning 504. (user channel)

But the weird behavior, is that when I joined another channel and the above error happened ^, the channel.streamUpdates for main channel, just stopped work and doesn't listen new messages.

After I removed the code above for currentUser.streamUpdates the main channel started working again.

@manfe
Copy link
Author

manfe commented Oct 25, 2024

Ok, we found a root cause, when trying to join a channel nothing is thrown, but when I listed the events for the sdk, it was returning 403 when trying to join the user channel and also user channel pnpres, so the network call for leave the channel was failing because it never succeeded to join it.

So we have an issue of not throwing error when a 403 error happens to join a channel.

Also the documentation of streamUpdates for Users, must be clear about the Access Manager permission needed to make it work correctly.

And, when a 403 happens on user streamUpdates, the channel.connect stopped receiving messages.

@piotr-suwala
Copy link
Contributor

Hey, @manfe. We have acknowledged the problem and will put this into our backlog.

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

No branches or pull requests

2 participants