Layer.scoped. Stream, but I don't know what to trigger when I get an error. You can look at my code here: https://gist.github.com/wewelll/c30c3128cdcc43a02acd4eede73471c5. I don't know how to trigger a refresh of the layer.SynchronizedRef of the connection, so I could just update the connection ref with a new instance of the connection, but it seems a bit over-engineered.