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

Catch errors from extra event unsubscribe request #401

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

redstone99
Copy link
Contributor

Prevent one source of "uncaught promise" errors on the console.

It appears the chain of steps causing it is:
After the client unsubscribes from an event, this library may receive an extra event message (I'm not sure why). That event message causes the library to send a second unsubscribe request (connection.ts, line 377). The server (which already unsubscribed due to the first request) may respond with an error of "subscription not found". This PR catches that error so it doesn't bubble up to the console.

lib/connection.ts Outdated Show resolved Hide resolved
@balloob balloob merged commit c63612c into home-assistant:master Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants