Summary:
If after 5 hours there are no connected clients, shutdown the server.
This is to prevent cases whereas the long-lived instance makes users use stale versions of Flipper if Flipper stays indefinitely running in the background.
Reviewed By: passy
Differential Revision: D51111926
fbshipit-source-id: 4c38e392cf8a6a4fb840bffdea92c0b0314aefb9
Summary:
The socket will close as the endpoint is terminating the connection.
Status code 1000 and 1001 are used for normal closures. Either the connection is no longer needed or the endpoint is going away i.e. browser navigating away from the current page.
WS RFC: https://www.rfc-editor.org/rfc/rfc6455
Reviewed By: LukeDefeo
Differential Revision: D48896696
fbshipit-source-id: 22070ae34b7f35d35589db06108feb718e73e866
Summary: Removing this information from the error as it will cause duplicated error tasks.
Reviewed By: passy
Differential Revision: D48646678
fbshipit-source-id: 26e5525318b4720568275a5086df00f21b7d2836
Summary:
For dev, let's not kill the server.
Also, reintroduce a timeout of 60 seconds before disconnecting.
Reviewed By: antonk52
Differential Revision: D48432317
fbshipit-source-id: bac6f67101e5be481af06a5ea6ccb3b3134c4075
Summary: Instead of delaying the shutdown by a set timer, immediately shutdown.
Reviewed By: antonk52
Differential Revision: D48264571
fbshipit-source-id: 5e6556f2ecafb7cf9a19b3075e72f2be1abf9f95
Summary: This is quite annoying and causes may un needed reboots of flipper server while developing
Reviewed By: antonk52
Differential Revision: D47949842
fbshipit-source-id: c2f18e16a4933e4209e74f51978cb7d05b80ee11
Summary: If after 15min there are no connected clients, close flipper server.
Reviewed By: antonk52
Differential Revision: D46519563
fbshipit-source-id: c3396ed8987be8ca7075c644734793e4ebceba18
Summary: For the Flipper Server Companion, if a plugin is being requested which is not yet installed, try to install it first from the marketplace.
Reviewed By: passy
Differential Revision: D37716962
fbshipit-source-id: d618fbc597f82b540dbb02e8ffc296dcee9e1eb9
Summary:
This change attaches our event handlers as soon as the ws is created.
As a consequence, we need to wait until the server has created any necessary instances required to process incoming requests.
To achieve this, I created a type called `Lazy`.
This type wraps around a value and a promise to that value. Callers can check if the value is set. If not, callers can wait for it.
Ultimately, the value can be set outside of the promise itself.
Reviewed By: passy
Differential Revision: D37284939
fbshipit-source-id: 17dec548d7155a3d65440c9584cec07cbb826c37
Summary:
After doing some tests, any error thrown during ws events can result in flipper-server shutting down.
To avoid this, effectively, errors throughout should be properly handled.
The problem is that there's no guarantees this is or will be the case.
Instead, wrap the event handlers in a safe function execution wrapper. Any errors will be caught and logged.
Reviewed By: aigoncharov
Differential Revision: D37206923
fbshipit-source-id: 6f7cadc297ac39768030962c6eaadde55048fd21
Summary:
This changes moves most of the functionality found in flipper-server to flipper-server-core.
flipper-server will mostly be a package that wraps around flipper-server-core. Staying in flipper-server:
- Command line args
- Orchestration to start the necessary servers
Reviewed By: aigoncharov
Differential Revision: D36807087
fbshipit-source-id: f29002c7cc5d08b8c5184fdaaa02ba22562a9f45