You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found a couple of problems when using streams, all related to stream.close() on the browser.
The first one is that after using stream.close() it's not possible to restart the stream again with stream.start(). A new stream has to be created and started, otherwise this error is thrown:
The stream has already been started.
If this by design the error should at least inform that a new instance has to be created on every subscription.
The second problem is that after using stream.close() the internal event listeners are not being cleared up properly.
I tried to subscribe to an inexistent document (on purpose to trigger errors) with the following error handler:
After the error is triggered, the current stream is closed and a new one is created on each retry. Since the document does not exist, a new stream is created every 250ms in a loop. As you can see from Chrome's dev tools, the event listeners keep growing continually even though the garbage collector has been clearing the heap regularly:
It could be I'm missing something, but from looking at the source, there doesn't seem to be a method to destroy the stream properly.
It's possible the issue is actually in the polyfills of the Node libraries the JS driver requires to work on the browser. OTOH it's quite strange that the end user has to provide polyfills to use the JS driver on a modern browser...
The text was updated successfully, but these errors were encountered:
I've found a couple of problems when using streams, all related to
stream.close()
on the browser.The first one is that after using
stream.close()
it's not possible to restart the stream again withstream.start()
. A new stream has to be created and started, otherwise this error is thrown:If this by design the error should at least inform that a new instance has to be created on every subscription.
The second problem is that after using
stream.close()
the internal event listeners are not being cleared up properly.I tried to subscribe to an inexistent document (on purpose to trigger errors) with the following error handler:
After the error is triggered, the current stream is closed and a new one is created on each retry. Since the document does not exist, a new stream is created every 250ms in a loop. As you can see from Chrome's dev tools, the event listeners keep growing continually even though the garbage collector has been clearing the heap regularly:
It could be I'm missing something, but from looking at the source, there doesn't seem to be a method to destroy the stream properly.
It's possible the issue is actually in the polyfills of the Node libraries the JS driver requires to work on the browser. OTOH it's quite strange that the end user has to provide polyfills to use the JS driver on a modern browser...
The text was updated successfully, but these errors were encountered: