Currently (feature/patch-uiff0bbcac), we use reconnecting-websocket to establish a robust WebSocket connection to the Server. However, Firefox has a very strict rate limiter for failed WebSocket connections (https://bugzilla.mozilla.org/show_bug.cgi?id=711793#c0). In the extreme case, we can only check for a WebSocket connection every 60 seconds. So if we try to reconnect every second on Firefox, this is the resulting network traffic:
The only way to stop this rate limiting is to restart Firefox. Reload does not work. For comparison, Chrome's rate limiting is much less aggressive:
However, this means that if we want to support Firefox properly, we need to use a different mechanism than WebSocket connects for checking whether the server is available.
TODO
[x] Research how to find out with HTTP whether a server is reachable
[x] new API endpoint?
[x] or just make a HTTP request to ws?
[x] => make a HEAD request to the server. Could only fail if we hit a cache, but I think our server currently forbids browser-side caching.
[ ] Implement a ConnectionProvider that handles this (class or hook?)
[ ] check in regular intervals with HTTP whether the server is available
[ ] if yes, connect WebSocket once or twice
[ ] if that fails, go back to checking with HTTP
[ ] communicate the connection state outwards
[ ] Subscriptions need to be reset when closing
[ ] Subscriptions need to be made when opening
[ ] Connection Error Alert needs to be shown when HTTP cannot reach server
[ ] Connection Error Alert should communicate when the connection is checked (bar going down, countdown, ?)
[ ] test with Cypress
[ ] ensure this also works with the frontend dev server
Currently (
feature/patch-ui
ff0bbcac
), we use reconnecting-websocket to establish a robust WebSocket connection to the Server. However, Firefox has a very strict rate limiter for failed WebSocket connections (https://bugzilla.mozilla.org/show_bug.cgi?id=711793#c0). In the extreme case, we can only check for a WebSocket connection every 60 seconds. So if we try to reconnect every second on Firefox, this is the resulting network traffic: The only way to stop this rate limiting is to restart Firefox. Reload does not work. For comparison, Chrome's rate limiting is much less aggressive:However, this means that if we want to support Firefox properly, we need to use a different mechanism than WebSocket connects for checking whether the server is available.
TODO
HEAD
request to the server. Could only fail if we hit a cache, but I think our server currently forbids browser-side caching.