Skip to content

Realtime Updates

Diagram

Overview

Users can receive updates about the floorplan from the server by calling FloorplanObjectsSocket.subscribe.

This creates a websocket connection. Whenever the floorplans or layouts services receive updates related to the user's floorplan, the user will get an update about it through the websocket.

The flow of data is as follows:

  1. A user updates the floorplan and sends a REST request to the server (either floorplans or layouts)
  2. The server updates the floorplan forward the payload through redis.
  3. floorplans listens to the redis channel and sends the payload to the user through the websocket.
  4. The user receives the payload and updates the floorplan.

Known Issues

  • Currently simultaneously listening and sending is not supported. We need to differentiate between the user's updates and other user's updates to prevent infinite send loops.
  • On disconnect & reconnect to the websocket, we resubscribe to updates, but we might have missed some updates. This means some changes might not be visible. We need to load the whole floorplan again before resubscribing.