-
Notifications
You must be signed in to change notification settings - Fork 131
useTextStream encounters TypeError('A text stream handler for topic...') upon browser refresh #1118
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
useTextStream encounters TypeError('A text stream handler for topic...') upon browser refresh #1118
Conversation
🦋 Changeset detectedLatest commit: 8a26836 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks, this is indeed a bug, but I think we'd rather want to find a way to remove the The main reason why it's in there is to reset the array after the room transitioned from a connected to a disconnected state. |
… removed unnecessary memoization of isDisconnected.
|
@lukasIO lmk if that latest commit is what you're suggesting. Tested it against our application and used the "Offline" feature of the Chrome network tab to try and simulate the disconnected flow you're mentioning. |
lukasIO
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, looking good apart from the nit with the import
lukasIO
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the fix!
Upon browser refresh we're hitting this error
https://github.com/livekit/client-sdk-js/blob/1a5a96638f42222eee323fb7947f0e336aa697fe/src/room/Room.ts#L292
we're using the useTextStream hook that was recently introduced. I believe there's a bug where when isDisconnected changes to true (upon browser refresh) then this memo runs again and it hits that invalid state.