Commit Graph

12 Commits

Author SHA1 Message Date
Pascal Hartig
dc6dd47a23 Make openssl check async
Summary:
This was the last eslint warning for `flipper-server-core` and the only call-site
was async already.

Reviewed By: mweststrate

Differential Revision: D32026626

fbshipit-source-id: 0d6f06086c33707b26f58f668ad533daca9de7dd
2021-11-03 05:40:04 -07:00
Michel Weststrate
72ce759e61 Remove some unhandled rejections in tests
Summary: Fixed several tests that caused uncaught promise rejects to fire after the tests finished. This caused jest to fail if there are too many of them.

Reviewed By: aigoncharov

Differential Revision: D32118124

fbshipit-source-id: 50734dab6dee2efec7f056940af72858b27b1707
2021-11-03 03:14:08 -07:00
dependabot[bot]
7094475431 Bump split2 from 3.2.2 to 4.1.0 in /desktop (#3002)
Summary:
Bumps [split2](https://github.com/mcollina/split2) from 3.2.2 to 4.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/mcollina/split2/releases">split2's releases</a>.</em></p>
<blockquote>
<h2>v4.1.0</h2>
<h2>What’s Changed</h2>
<ul>
<li>Add engines field. Add node 10.x to CI (<a href="https://github-redirect.dependabot.com/mcollina/split2/issues/52">https://github.com/facebook/flipper/issues/52</a>) <a href="https://github.com/mcollina"><code>@​mcollina</code></a></li>
</ul>
<h2>v4.0.0</h2>
<h2>What’s Changed</h2>
<ul>
<li>Update to node 12 (<a href="https://github-redirect.dependabot.com/mcollina/split2/issues/50">https://github.com/facebook/flipper/issues/50</a>) <a href="https://github.com/mcollina"><code>@​mcollina</code></a></li>
<li>Upgrade to GitHub-native Dependabot (<a href="https://github-redirect.dependabot.com/mcollina/split2/issues/48">https://github.com/facebook/flipper/issues/48</a>) <a href="https://github.com/dependabot-preview"><code>@​dependabot-preview</code></a></li>
<li>Bump standard from 15.0.1 to 16.0.1 (<a href="https://github-redirect.dependabot.com/mcollina/split2/issues/43">https://github.com/facebook/flipper/issues/43</a>) <a href="https://github.com/dependabot-preview"><code>@​dependabot-preview</code></a></li>
<li>Bump standard from 14.3.4 to 15.0.0 (<a href="https://github-redirect.dependabot.com/mcollina/split2/issues/41">https://github.com/facebook/flipper/issues/41</a>) <a href="https://github.com/dependabot-preview"><code>@​dependabot-preview</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="06818424cb"><code>0681842</code></a> Bumped v4.1.0</li>
<li><a href="beff8a031c"><code>beff8a0</code></a> Add engines field. Add node 10.x to CI (<a href="https://github-redirect.dependabot.com/mcollina/split2/issues/52">https://github.com/facebook/flipper/issues/52</a>)</li>
<li><a href="b66af507ca"><code>b66af50</code></a> Bumped v4.0.0</li>
<li><a href="f662904a41"><code>f662904</code></a> Update to node 12 (<a href="https://github-redirect.dependabot.com/mcollina/split2/issues/50">https://github.com/facebook/flipper/issues/50</a>)</li>
<li><a href="4a776ffa20"><code>4a776ff</code></a> Upgrade to GitHub-native Dependabot (<a href="https://github-redirect.dependabot.com/mcollina/split2/issues/48">https://github.com/facebook/flipper/issues/48</a>)</li>
<li><a href="c3124e3d9b"><code>c3124e3</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/mcollina/split2/issues/43">https://github.com/facebook/flipper/issues/43</a> from mcollina/dependabot/npm_and_yarn/standard-16.0.1</li>
<li><a href="efe0ddd808"><code>efe0ddd</code></a> Bump standard from 15.0.1 to 16.0.1</li>
<li><a href="bc6e5fc7fb"><code>bc6e5fc</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/mcollina/split2/issues/41">https://github.com/facebook/flipper/issues/41</a> from mcollina/dependabot/npm_and_yarn/standard-15.0.0</li>
<li><a href="03c7cecc3c"><code>03c7cec</code></a> Bump standard from 14.3.4 to 15.0.0</li>
<li>See full diff in <a href="https://github.com/mcollina/split2/compare/v3.2.2...v4.1.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=split2&package-manager=npm_and_yarn&previous-version=3.2.2&new-version=4.1.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)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

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)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/3002

Reviewed By: passy

Differential Revision: D31991563

Pulled By: cekkaewnumchai

fbshipit-source-id: 3a133ca1d60a0ec471147ac7af4c9772060c6e35
2021-10-28 06:18:11 -07:00
Lorenzo Blasa
ef8557b5a1 Improve error message for unresponsive clients
Summary:
This change adds 'adb' to the error message checks. If the device is Android, is confusing to suggest the problem may be with 'idb'.

This could be further improved by looking at the client OS and device type to suggest formulate the correct message.

Reviewed By: passy

Differential Revision: D31894695

fbshipit-source-id: 8eb2ca152807afd9706af1523c917803611246d7
2021-10-25 06:50:49 -07:00
Andrey Goncharov
02115722b3 Implement React example of WS integration with Flipper
Summary: Create an example of how one can use `js-flipper` in a browser to connect to Flipper over WS.

Reviewed By: mweststrate

Differential Revision: D31688114

fbshipit-source-id: 135f826daeddeda8dca5b3df6504cc2bdc04dd1b
2021-10-21 09:13:18 -07:00
Andrey Goncharov
37498ad5a9 Refactor server implementation for WebSockets
Summary:
Standardize WS implementation for JS environments.

Why do we need a separate server implementation for browsers?
Browser targets cannot authenticate via the default certificate exchange flow. For browser targets we verify the origin instead.
Moreover, for already forgotten reasons the initial implementation of the WS server for browsers used a different kind of message structure and added extra `connect`/`disconnect` messages. After examination, it seems the `connect`/`disconnect` flow is redundant.

Major changes:
1. Updated class hierarchy for WS server implementations.
2. Updated browser WS server to support the modern and the legacy protocols.
3. Now a websocket connection with the device is closed on error. The idea is it is highly unlikely to handle any subsequent messages properly once we observe an error. It is better to bail and reconnect. What do you think?

Reviewed By: mweststrate

Differential Revision: D31532172

fbshipit-source-id: f86aa63a40efe4d5263353cc124fac8c63b80e45
2021-10-21 03:34:15 -07:00
Michel Weststrate
6589eb86c5 Improve port forwarding logging
Summary: Port forwarding tool was logging the child process object. Made the logging cleaner and more useful.

Reviewed By: nikoant

Differential Revision: D31608867

fbshipit-source-id: 1c2ae7c926ed4e1b44d51db5415874600acde7ae
2021-10-14 03:17:47 -07:00
Michel Weststrate
f43ff73591 Addressed some earlier diff comments
Summary: Async processed review feedback from stack D31474919 (cfd44b592a) e.o. (decapitate)

Reviewed By: passy

Differential Revision: D31608309

fbshipit-source-id: 536b3c9350f7acc40530000ecf5e46d5b074d50f
2021-10-14 03:17:47 -07:00
Lorenzo Blasa
423a2c6c06 Alt ports to be reversed on Android
Summary: This change adds the alt ports to the list of ports to be reversed on Android

Reviewed By: mweststrate

Differential Revision: D31607559

fbshipit-source-id: 4e1201c7255fcd3a437c743f827ae4bceb746348
2021-10-13 10:31:41 -07:00
Anton Nikolaev
976e53ff9b Avoid logging csr
Summary: I unintentionally added logging of csr certificates in my previous diff. This diff makes sure we're not logging them anymore.

Reviewed By: mweststrate

Differential Revision: D31609709

fbshipit-source-id: e43b348dbd62653f8a6e9089930c2a3699b29a12
2021-10-13 08:38:56 -07:00
Michel Weststrate
d88b28330a Move app/server to flipper-server-core
Summary: moved `app/src/server` to `flipper-server-core/src` and fixed any fallout from that (aka integration points I missed on the preparing diffs).

Reviewed By: passy

Differential Revision: D31541378

fbshipit-source-id: 8a7e0169ebefa515781f6e5e0f7b926415d4b7e9
2021-10-12 16:00:52 -07:00
Michel Weststrate
c3ff0ff355 Set up Flipper decapitated packages
Summary:
This diff introduces the packages necessary for Flipper decapitated.

* flipper-common: utilities & types shared between client, server, flipper-plugin
* flipper-server-core: all device & client management goes in here. Basically flipper's backend
* flipper-ui-core: all UI goes in here, as far as it doesn't depend on Electron
* desktop: the Electron app, will load server-core and ui-core, and glue them together, providing implementations for some electron specific stuff like dialgos
* flipper-server: A node process hosting flipper-server-core, that can be connected to over websockets. And probably can serve a browser version of the UI as well.
* flipper-ui-browser: thin wrapper around flipper-ui-core, providing some browser specific behavior / stubs.
* flipper-dump: (might remove later), but want to hack a quick and dirt flipper dump in here, as alternative way to test flipper-server-core.

This diff just creates the packages, but doesn't move any code, so it can be summarized as:

restoftheowl

Reviewed By: nikoant

Differential Revision: D30218646

fbshipit-source-id: 735598a1261a98e584f52504b5eba01ec0afa162
2021-10-08 01:33:03 -07:00