Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

[OTHER] Client-side reconnection to websockets #25

@stemount

Description

@stemount

What would you like to share?

As per sharing on Discord, scaling websockets across services requires a lot more work and deployments or any hiccup in network will prevent reconnection.

This would be a good idea regardless of having a "fix" for this problem to reconnect after a 500ms delay to the Live API websocket.

  • [] Getting rid of the old poller method for good
  • [] Reconnecting after 500ms for any service blips due to deployment
--- a/src/context/socket.js
+++ b/src/context/socket.js
@@ -3,5 +3,7 @@ import { SOCKET_URL } from "../config";
 
 export const socket = io.connect(SOCKET_URL, {
   // WARNING: in that case, there is no fallback to long-polling
-  transports: ["websocket", "polling"], // or [ "websocket", "polling" ] (the order matters)
+  transports: ["websocket"], // or [ "websocket", "polling" ] (the order matters)
+  reconnection: true,

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions