_hyperscript icon indicating copy to clipboard operation
_hyperscript copied to clipboard

eventsource close() does not work on a failing connection.

Open daroot opened this issue 3 years ago • 1 comments

Discovered by misspelling my endpoint.

The eventsource keeps attempting to reconnect every second, and calling me.close() in the on error handler does not stop the attempts to reconnect. In fact, it seems to make it worse, as it then immediately attempts to reconnect, rather than waiting the normal second.

If the eventsource can connect, thereafter the close() method works as expected and stops the connection without attempting to reconnect.

image

daroot avatar Feb 15 '22 05:02 daroot

Thanks for posting this. Hyperscript clearly should not do this. I'll try to see what's happening and make a fix.

benpate avatar Feb 16 '22 15:02 benpate