home-assistant / home-assistant-js-websocket

:aerial_tramway: JavaScript websocket client for Home Assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

refresh will resolve if it fails because of closed connection

balloob opened this issue · comments

While fixing the rejected promises when subscribing while the connection was closed, we accidentally introduced a bug: the refresh function will now resolve while the refresh did not happen yet.

We should reject instead.

This issue became apparent because with #68, we're exposing collections and their refresh functions.

We should make sure that the place where refresh is called from subscribeEvents still properly handles the closed connection case.