Add legacy connection warning

Summary: Add legacy connection warning

Reviewed By: passy

Differential Revision: D32694056

fbshipit-source-id: e6d1c2fb5aea607d090ab45879c5a46d5fd17dab
This commit is contained in:
Andrey Goncharov
2021-11-29 04:22:20 -08:00
committed by Facebook GitHub Bot
parent d71b63a8d8
commit 39841292d1

View File

@@ -79,7 +79,10 @@ class BrowserServerWebSocket extends SecureServerWebSocket {
// Remove this part once our current customers migrate to the new message structure // Remove this part once our current customers migrate to the new message structure
if (isLegacyMessage(parsedMessage)) { if (isLegacyMessage(parsedMessage)) {
if (parsedMessage.type === 'connect') { if (parsedMessage.type === 'connect') {
// TODO: Show a user warning about legacy message structure and protocol. Provide them with clear instructions on how to upgrade. // TODO: Add a link to a blog post when it is ready.
console.warn(
'[conn] Legacy WebSocket connection. Please, upgrade. See https://github.com/facebook/flipper/tree/main/js/js-flipper for references.',
);
// Legacy protocol supported passing an optional list of plugins with a 'connect' message. // Legacy protocol supported passing an optional list of plugins with a 'connect' message.
// Clients that pass the list of plugins this way might not suport `getPlugins` call. // Clients that pass the list of plugins this way might not suport `getPlugins` call.