fix: reconnect to /events if disconnected #4809
Merged
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 does this PR do?
When a provider is added, we establish a connection to
/events
REST API handler.but if provider is not restarted and ping is still replying, we could have been disconnected from this stream.
It might happen if machine is restarting or some network issues.
In that case, re-establish the connection to the events so UI is properly refreshed. Because without events, we do not refresh the UI automatically
Screenshot/screencast of this PR
N/A
What issues does this PR fix or reference?
fixes #4712
How to test this PR?
hard to test but I've added a unit test
you can for example to test, drop the update of the status in podman extension so you can do 'podman machine stop' wait and then 'podman machine start' and it'll reconnect
you should see mesages in the dev console that event connection has been dropped
Signed-off-by: Florent Benoit fbenoit@redhat.com