FFM-8067 Call onStreamError anytime we exit Subscribe #115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
onStreamError
anytime we break out of the SubscribeWithContext functionPub
method with an error. This lets the eventListener know that the stream its listening to has disconnectedWhy
onStreamError
if SubscribeWithContext returns an error. However if the stream is intentionally closed by the server rather than bubbling up the EOF error the SSE library we're using swallows it. This means we never callonStreamError
which means the SDK thinks it's still connected to the stream and receiving SSE events which means it stops getting any changes because it isn't operating in polling mode and won't get any SSE events. CallingonStreamError
means we'll setstreamConnected=false
and the SDK will poll for changes until it can reconnect to the streamTesting
I've been testing this out locally by getting the Proxy to close the stream with the SDK if it disconnects from ff-server