Skip to content

Added SocketManager, SubscriptionStore, Subscription, VisibilitySocketManager an…

Luke "Jared" Bennett requested to merge sockets-frontend into master

What does this MR do?

Frontend for sockets proposal starting here: https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/164

Added SocketManager to manage the single socket and to provide an interface to subscribe/unsubscribe and hook into realtime updates.

Added SubscriptionStore to track all subscriptions so we can unsubscribeAll and subscribeAll.

Added Subscription to classify and encapsulate the properties/actions of a specific subscription.

Added VisibilitySocketManager to extend SocketManager and provide the ability to unsubscribeAll and subscribeAll on visibilitychange.

Note:

This does lack the concept of notificationCallback, it could be added, but the case I saw, it was using it to trigger a spinner everytime a request was being made, so the user could know. Well, the whole point of sockets is to not have an explicit start to that wait for a request, so UX should probably look at our loading UX for sockets specifically.

Other than this, it is a complete replacement for Poll.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Merge request reports