From 97f861b2dc2c8eb677a17383b7e5e464a9ce8217 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jan 2022 05:02:15 -0800 Subject: [PATCH] Bump ws from 7.5.6 to 8.4.0 in /desktop (#3240) Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/3240 Bumps [ws](https://github.com/websockets/ws) from 7.5.6 to 8.4.0.
Release notes

Sourced from ws's releases.

8.4.0

Features

8.3.0

Features

Bug fixes

8.2.3

Bug fixes

8.2.2

Bug fixes

8.2.1

Bug fixes

8.2.0

Features

8.1.0

Features

Bug fixes

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ws&package-manager=npm_and_yarn&previous-version=7.5.6&new-version=8.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `dependabot rebase` will rebase this PR - `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `dependabot merge` will merge this PR after your CI passes on it - `dependabot squash and merge` will squash and merge this PR after your CI passes on it - `dependabot cancel merge` will cancel a previously requested merge and block automerging - `dependabot reopen` will reopen this PR if it is closed - `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Pull Request resolved: https://github.com/facebook/flipper/pull/3218 Reviewed By: antonk52, timur-valiev Differential Revision: D33348279 Pulled By: nikoant fbshipit-source-id: c245f53556e8f58ba1df619d3d0e106e8e5b1911 --- desktop/flipper-server-core/package.json | 4 ++-- .../src/comms/ServerWebSocket.tsx | 7 ++++--- desktop/static/package.json | 2 +- desktop/yarn.lock | 15 ++++++++++----- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/desktop/flipper-server-core/package.json b/desktop/flipper-server-core/package.json index 2e424c2aa..99914e96b 100644 --- a/desktop/flipper-server-core/package.json +++ b/desktop/flipper-server-core/package.json @@ -38,7 +38,7 @@ "tmp": "^0.2.1", "uuid": "^8.3.2", "which": "^2.0.2", - "ws": "^7.5.6", + "ws": "^8.4.0", "xdg-basedir": "^4.0.0" }, "devDependencies": { @@ -51,7 +51,7 @@ "@types/rsocket-tcp-server": "^0.0.2", "@types/split2": "^3.2.1", "@types/tmp": "^0.2.2", - "@types/ws": "^7.4.7", + "@types/ws": "^8.2.2", "@types/which": "^2.0.1", "memorystream": "^0.3.1", "tmp": "^0.2.1" diff --git a/desktop/flipper-server-core/src/comms/ServerWebSocket.tsx b/desktop/flipper-server-core/src/comms/ServerWebSocket.tsx index da98f20d8..a966e0a1a 100644 --- a/desktop/flipper-server-core/src/comms/ServerWebSocket.tsx +++ b/desktop/flipper-server-core/src/comms/ServerWebSocket.tsx @@ -161,11 +161,12 @@ class ServerWebSocket extends ServerAdapter { this.handleClientQuery(ctx); this.handleConnectionAttempt(ctx); - ws.on('message', async (message: unknown) => { + ws.on('message', async (message: WebSocket.RawData) => { try { - const parsedMessage = this.handleMessageDeserialization(message); + const messageString = message.toString(); + const parsedMessage = this.handleMessageDeserialization(messageString); // Successful deserialization is a proof that the message is a string - this.handleMessage(ctx, parsedMessage, message as string); + this.handleMessage(ctx, parsedMessage, messageString); } catch (error) { // See the reasoning in the error handler for a `connection` event ws.emit('error', error); diff --git a/desktop/static/package.json b/desktop/static/package.json index b596f0bf8..0dc6d67b2 100644 --- a/desktop/static/package.json +++ b/desktop/static/package.json @@ -10,7 +10,7 @@ "mac-ca": "^1.0.6", "mkdirp": "^1.0.4", "node-fetch": "^2.6.6", - "ws": "^7.5.6", + "ws": "^8.4.0", "xdg-basedir": "^4.0.0", "yargs": "^16.2.0" }, diff --git a/desktop/yarn.lock b/desktop/yarn.lock index 3c7c11e24..b31155f01 100644 --- a/desktop/yarn.lock +++ b/desktop/yarn.lock @@ -2870,10 +2870,10 @@ resolved "https://registry.yarnpkg.com/@types/which/-/which-2.0.1.tgz#27ecd67f915b7c3d6ba552135bb1eecd66e63501" integrity sha512-Jjakcv8Roqtio6w1gr0D7y6twbhx6gGgFGF5BLwajPpnOIOxFkakFhCq+LmyyeAz7BX6ULrjBOxdKaCDy+4+dQ== -"@types/ws@^7.4.7": - version "7.4.7" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" - integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== +"@types/ws@^8.2.2": + version "8.2.2" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.2.2.tgz#7c5be4decb19500ae6b3d563043cd407bf366c21" + integrity sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg== dependencies: "@types/node" "*" @@ -12612,11 +12612,16 @@ ws@^1.1.5: options ">=0.0.5" ultron "1.0.x" -ws@^7.4.5, ws@^7.5.6: +ws@^7.4.5: version "7.5.6" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== +ws@^8.4.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.4.0.tgz#f05e982a0a88c604080e8581576e2a063802bed6" + integrity sha512-IHVsKe2pjajSUIl4KYMQOdlyliovpEPquKkqbwswulszzI7r0SfQrxnXdWAEqOlDCLrVSJzo+O1hAwdog2sKSQ== + ws@~8.2.3: version "8.2.3" resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.3.tgz#63a56456db1b04367d0b721a0b80cae6d8becbba"