Commit Graph

1119 Commits

Author SHA1 Message Date
Michel Weststrate
816720d708 Stop reporting 'Failed to fetch' errors
Summary: Failed to fetch promise rejections should not be reported

Reviewed By: passy

Differential Revision: D31266851

fbshipit-source-id: ce3c15db5504c01d66b44e032c2b7fb752ec2ec3
2021-09-29 06:56:37 -07:00
dependabot[bot]
f5e4d27bc4 Bump pretty-format from 27.1.0 to 27.2.0 in /desktop (#2861)
Summary:
Bumps [pretty-format](https://github.com/facebook/jest/tree/HEAD/packages/pretty-format) from 27.1.0 to 27.2.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/facebook/jest/releases">pretty-format's releases</a>.</em></p>
<blockquote>
<h2>27.2.0</h2>
<h3>Features</h3>
<ul>
<li><code>[jest-resolver, jest-runtime]</code> Pass <code>conditions</code> to custom resolvers to enable them to implement support for package.json <code>exports</code> field (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11859">#11859</a>)</li>
<li><code>[jest-runtime]</code> Allow custom envs to specify <code>exportConditions</code> which is passed together with Jest's own conditions to custom resolvers (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11863">#11863</a>)</li>
</ul>
<h3>Fixes</h3>
<ul>
<li><code>[jest/reporters]</code> Use async transform if available to transform files with no coverage (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11852">#11852</a>)</li>
<li><code>[jest-util]</code> Return correct value from <code>process.send</code> stub (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11799">#11799</a>)</li>
</ul>
<h2>27.1.1</h2>
<h3>Features</h3>
<ul>
<li><code>[jest-runtime]</code> Add experimental, limited (and undocumented) support for mocking ECMAScript Modules (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11818">#11818</a>)</li>
</ul>
<h3>Fixes</h3>
<ul>
<li><code>[jest-resolver]</code> Support <code>node:</code> prefix when importing Node core modules with ESM (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11817">#11817</a>)</li>
<li><code>[jest-types]</code> Export the <code>PrettyFormatOptions</code> interface (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11801">#11801</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/facebook/jest/blob/main/CHANGELOG.md">pretty-format's changelog</a>.</em></p>
<blockquote>
<h2>27.2.0</h2>
<h3>Features</h3>
<ul>
<li><code>[jest-resolver, jest-runtime]</code> Pass <code>conditions</code> to custom resolvers to enable them to implement support for package.json <code>exports</code> field (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11859">#11859</a>)</li>
<li><code>[jest-runtime]</code> Allow custom envs to specify <code>exportConditions</code> which is passed together with Jest's own conditions to custom resolvers (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11863">#11863</a>)</li>
</ul>
<h3>Fixes</h3>
<ul>
<li><code>[jest/reporters]</code> Use async transform if available to transform files with no coverage (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11852">#11852</a>)</li>
<li><code>[jest-util]</code> Return correct value from <code>process.send</code> stub (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11799">#11799</a>)</li>
</ul>
<h2>27.1.1</h2>
<h3>Features</h3>
<ul>
<li><code>[jest-runtime]</code> Add experimental, limited (and undocumented) support for mocking ECMAScript Modules (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11818">#11818</a>)</li>
</ul>
<h3>Fixes</h3>
<ul>
<li><code>[jest-resolver]</code> Support <code>node:</code> prefix when importing Node core modules with ESM (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11817">#11817</a>)</li>
<li><code>[jest-types]</code> Export the <code>PrettyFormatOptions</code> interface (<a href="https://github-redirect.dependabot.com/facebook/jest/pull/11801">#11801</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="b05635c539"><code>b05635c</code></a> v27.2.0</li>
<li><a href="d6e5ddb0c3"><code>d6e5ddb</code></a> Rename all links to main (<a href="https://github.com/facebook/jest/tree/HEAD/packages/pretty-format/issues/11856">#11856</a>)</li>
<li><a href="111198b62d"><code>111198b</code></a> v27.1.1</li>
<li>See full diff in <a href="https://github.com/facebook/jest/commits/v27.2.0/packages/pretty-format">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pretty-format&package-manager=npm_and_yarn&previous-version=27.1.0&new-version=27.2.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/2861

Reviewed By: timur-valiev

Differential Revision: D30961750

Pulled By: mweststrate

fbshipit-source-id: 2c7a43755e840713b2233abbad7ce131785268b8
2021-09-29 04:38:38 -07:00
Ananya Arun
e974b28c8f Add no device found error msg to guide
Summary:
Added noDeviceErrorMsg as a JSX.Element that will display 'No device found' if there are no devices detected. It is an empty JSX.Element otherwise and nothing is displayed as shown in the video.

I am using a JS variable as a JSX element in this diff. This simplifies the if else checks needed inside return, and reused the same styling we have.

Reviewed By: mweststrate

Differential Revision: D31193647

fbshipit-source-id: dea96232785c9e2987be1513fa3462452c996e66
2021-09-28 09:57:49 -07:00
Joseph Chereshnovsky
795a3d30a0 Migrate away from deprecated instruments utility (#2903)
Summary:
The "instruments" utility was deprecated in Xcode 12 and removed now from Xcode 13, causing all the iOS 15 / Xcode 13  builds to fail to work with Flipper.

See deprecation notice here: https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes

> The instruments command is now deprecated in favor of its replacement: xctrace. Use xctrace to record, import, and export data from Instruments .trace files. (36641078)

The corresponding bug was reported here:
https://github.com/facebook/flipper/issues/2896

That call should be replaced with `xcrun xctrace` run and that is what we are doing here.

IMPORTANT: There was a workaround on killing the stale `instruments` proceses and that utility function is removed as part of this PR, as `instruments` were slow and inefficient, marked for deprecation more than a year ago. `xctrace` should not have that kind of issue and it doesn't make sense to keep this workaround now.

## Changelog

The "instruments" call replaced with `xcrun xctrace` use, to align with deprecation introduced in Xcode 12 and offer Xcode 13 compatibility.

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

Test Plan:
In order to test this we should run the Flipper desktop app and make sure it connects to the Simulator started out of Xcode 13
It fails to do so in `master` version right now, see https://github.com/facebook/flipper/issues/2896

Reviewed By: mweststrate

Differential Revision: D31150276

Pulled By: passy

fbshipit-source-id: 0b45ae23c15a8481a91b1effe814176b04adbf3e
2021-09-28 08:21:34 -07:00
dependabot[bot]
169feb6dc6 Bump @testing-library/react from 12.0.0 to 12.1.0 in /desktop (#2887)
Summary:
Bumps [testing-library/react](https://github.com/testing-library/react-testing-library) from 12.0.0 to 12.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/testing-library/react-testing-library/releases"><code>@​testing-library/react</code>'s releases</a>.</em></p>
<blockquote>
<h2>v12.1.0</h2>
<h1><a href="https://github.com/testing-library/react-testing-library/compare/v12.0.0...v12.1.0">12.1.0</a> (2021-09-11)</h1>
<h3>Features</h3>
<ul>
<li>improve JSDocs for RenderOptions (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/909">https://github.com/facebook/flipper/issues/909</a>) (<a href="fbacb0da99">fbacb0d</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="3325061cac"><code>3325061</code></a> docs: add ImADrafter as a contributor for doc (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/961">https://github.com/facebook/flipper/issues/961</a>)</li>
<li><a href="fbacb0da99"><code>fbacb0d</code></a> feat: improve JSDocs for RenderOptions (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/909">https://github.com/facebook/flipper/issues/909</a>)</li>
<li><a href="071a6fdc1d"><code>071a6fd</code></a> test: Format codebase with prettier (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/959">https://github.com/facebook/flipper/issues/959</a>)</li>
<li><a href="68fd459149"><code>68fd459</code></a> test: Ensure broken node 16.9.0 isn't used (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/960">https://github.com/facebook/flipper/issues/960</a>)</li>
<li><a href="8f3bd3c34f"><code>8f3bd3c</code></a> docs: add leschdom as a contributor for doc (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/941">https://github.com/facebook/flipper/issues/941</a>)</li>
<li><a href="801edaa0d6"><code>801edaa</code></a> docs(CONTRIBUTING): update links (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/932">https://github.com/facebook/flipper/issues/932</a>)</li>
<li>See full diff in <a href="https://github.com/testing-library/react-testing-library/compare/v12.0.0...v12.1.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@testing-library/react&package-manager=npm_and_yarn&previous-version=12.0.0&new-version=12.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/2887

Reviewed By: mweststrate

Differential Revision: D31203906

Pulled By: passy

fbshipit-source-id: a4d9c57c36dc5949396df841742a17f51a42c079
2021-09-27 12:42:27 -07:00
Michel Weststrate
f98526a2c9 Added unit tests to protect against broken startup sequence
Summary: Add unit tests to test errors thrown from plugins during initialisation, as follow up for D31127969 (a72e46c792). From the 4 tests cases added (first load plugin then device, device then plugin, first load plugin then client, first client then plugin), the first case was indeed failing before the mentioned diff and not registering the device.

Reviewed By: passy

Differential Revision: D31142583

fbshipit-source-id: 8e44c667316192231d1bb5e4d76c5bf1207ba835
2021-09-27 12:16:20 -07:00
Michel Weststrate
b539f4d870 Fix startLogging / stopLogging for ArchivedDevice
Summary:
Unit test would fail on trying to emit server commands when creating a ArchivedDevice. But archived devices can silently ignore log start commands, which fixes the failing test as well.

Example failing run: https://github.com/facebook/flipper/runs/3685776120

I'm not sure why the test wasn't _always_ failing

Reviewed By: lblasa

Differential Revision: D31142584

fbshipit-source-id: 57106ecdace9f72444eaf68ee9fa024c84556a1c
2021-09-27 02:16:45 -07:00
Michel Weststrate
987755bb09 Improve device destruction code [8/n]
Summary: Some cleanup in device destruction code. This diff wraps up the stack that decouples device management from the UI. Next steps are client management, and system management (file access / command execution)

Reviewed By: passy

Differential Revision: D31084036

fbshipit-source-id: 93efee7dba2193589d3c08c51128ce03de5eff7f
2021-09-27 02:12:53 -07:00
Michel Weststrate
a72e46c792 Fix error handling in plugin loading
Summary: If a device plugin throw an error in it's initialization, it would prevent the device itself from being registered. This fixes that. As shown in the comments of for example: https://fb.workplace.com/groups/flippersupport/permalink/1218627761951213/

Reviewed By: ananyaarun

Differential Revision: D31127969

fbshipit-source-id: 9824d23b275f1f9e866f841035961e4707ff8e04
2021-09-23 02:52:54 -07:00
Michel Weststrate
3882357579 Factor out realDevice [7/n]
Summary: `device.realDevice` was the escape hatch used in Sandy plugins to give access to device specific features like taking screenshots, clearing logs or accessing `adb`. Since in decapitated Flipper that won't be possible anymore (since plugins run in the client but device implementations on the server), all escape hatches have been bridged in this stack, and we can get of the `realDevice` interaction, by explicitly exposing those cases, which makes it type safe as well.

Reviewed By: passy

Differential Revision: D31079509

fbshipit-source-id: c9ec2e044d0dec0ccb1de287cf424907b198f818
2021-09-22 09:03:33 -07:00
Michel Weststrate
11a27f9e1a Support forward command [6/n]
Summary: Support the adb forward command

Reviewed By: jameslawson

Differential Revision: D31055957

fbshipit-source-id: bc0593320d0e187ddfc8120c1684746f9e9c4cf5
2021-09-22 09:03:33 -07:00
Michel Weststrate
4463e7ede2 Restore metro functionality [4/n]
Summary: Restored Metro functionality; progress reports, metro logs, RN/Hermes debugging, reload / dev menu button

Reviewed By: passy

Differential Revision: D31055958

fbshipit-source-id: c243035c343c14718a9afe275c8f5f36a1aa3a94
2021-09-22 09:03:32 -07:00
Michel Weststrate
3428ce2968 Restore device icons [3/n]
Summary: Restored support for device icons which was disabled in previous diff

Reviewed By: passy

Differential Revision: D31054802

fbshipit-source-id: 107a53f06159211534cb9a2316340af7a7ca530a
2021-09-22 09:03:32 -07:00
Michel Weststrate
2d838efd4d Separate device in server and client version [2/n]
Summary:
This stack takes care of handling care of moving all device interactions over the (possible) async channel FlipperServer. The FlipperServer interface (see previous diff) allows listening to specific server events using `on`, and emit commands to be executed by the server by using `exec` (e.g. `exec('take-screenshot', serial) => Promise<buffer>`).

FlipperServerImpl implements this interface on the server side.

The device implementations are split as follows

```
server / backend process:

ServerDevice
- iOSDevice
- AndroidDevice
- MetroDevice
- DummyDevice
- Mac/Windows Device

frontend / ui:

BaseDevice: a normal connected, device, implements device apis as they already existed
- ArchivedDevice (note that this doesn't have a server counterpart)
- TestDevice (for unit tests, with stubbed backend communication)

```

All features of devices are for simplicity unified (since the deviations are small), where specific device types might not implement certain features like taking screenshots or running shell commands.

To avoid making this diff unnecessarily big, some open Todo's will be addressed later in this stack, and it shouldn't be landed alone.

Reviewed By: timur-valiev

Differential Revision: D30909346

fbshipit-source-id: cce0bee94fdd5db59bebe3577a6084219a038719
2021-09-22 09:03:32 -07:00
Michel Weststrate
845d0755f1 Move common types to flipper-plugin [1/n]
Summary: This is the first diff in a stack of many where server and UI logic is further decoupled to be only communication through an event listener / emitting commands, where all data going over these media is json serializable. In this diff we extract the common interfaces that are to be used by both server and UI layer.

Reviewed By: passy

Differential Revision: D30899609

fbshipit-source-id: dc3c783707d47671f1d0f5dbf99cde17a8f69062
2021-09-22 09:03:32 -07:00
Alex Yur
d5aaa0034d Improve UI when no devices connected
Summary: Remove empty dropdown when no devices connected. Show 'No devices available' test instead.

Reviewed By: passy

Differential Revision: D31088007

fbshipit-source-id: 8a3bf0e8fbff04c7dfe2581f95576b3ab5ed4bcb
2021-09-21 11:44:35 -07:00
Wenhuan Li
4244563b67 fix take screenshot button state
Summary: Take screenshot button state is not reset after screenshot taken. So Flipper can only take 1 screenshot per session.

Reviewed By: mweststrate

Differential Revision: D31018526

fbshipit-source-id: dc7b00f26c77ec94a8a15047f5ae835acdb710c7
2021-09-17 11:24:08 -07:00
Michel Weststrate
c865446312 Fixed issue where ADB would be initialised, despite being disabled in settings
Summary:
As reported here: https://github.com/facebook/flipper/issues/2873, ADB would be initialised, even when disabled explicitly, resulting in an error if ADB could not be found.

Changelog: Fix: made sure that the "Android disabled" setting is respected.

Reviewed By: lblasa

Differential Revision: D31019099

fbshipit-source-id: 9d57945f2c21655426da42eb976dd46d8605d007
2021-09-17 07:24:57 -07:00
Michel Weststrate
dcac1db50f Cleanup android utilities
Summary: Some code simplification. The validation functions are not async, so don't need promises. By combining the internal and non internal files, a lot of utilities can be kept local instead of exposing them

Reviewed By: lblasa

Differential Revision: D31018355

fbshipit-source-id: be568a70fc84971dbce82a8478495edf7dafb4a5
2021-09-17 07:24:57 -07:00
Michel Weststrate
236bc44609 Fix SparkAR connection
Summary:
Changelog: Fixed skyline no longer connecting to Flipper

Per https://fb.workplace.com/groups/flippersupport/permalink/1214902038990452/. Reverts a change introduced here: https://www.internalfb.com/diff/D30838947 (d8f77db632)?transaction_fbid=439205157417044

Reviewed By: lblasa

Differential Revision: D30992087

fbshipit-source-id: 529f473807b53137b20fd39c37be95e6d7ec0c6d
2021-09-17 05:23:15 -07:00
Michel Weststrate
3ee8aef154 Fix bug in iOSDevice detection if both physical and emulator are active
Summary:
When connecting both to an iOS emulator and physical device, the emulator devices would continuesly be replaced, and Flipper would print the warning

`Tried to replace still connected device XXX with a new instance`

Fixed the logical mistake that causes it. Not sure if this caused any actual bugs, but at least it was incorrect.

Reviewed By: lblasa

Differential Revision: D31015451

fbshipit-source-id: 32dd29043e9dc48357fdbf68cde930d3be11419a
2021-09-17 05:23:15 -07:00
Michel Weststrate
5739e0c943 Fix CSR exchange exception disappearing in the void
Summary: I accidentally wrote a cert at the wrong location, but noticed that there was never raised an exception. Added error handing to surface the error. Seems the underlying RSocket implementation silently eats errors that escape from handlers....

Reviewed By: lblasa

Differential Revision: D31015168

fbshipit-source-id: 38480921c3cf33f3a5d91eb2ed4e3a912fdf74a7
2021-09-17 05:23:14 -07:00
Michel Weststrate
41286ce4b8 Some minor logging fine tuning
Summary: Per title

Reviewed By: lblasa

Differential Revision: D31015170

fbshipit-source-id: 5e50c9cb7b3d65eb745be8f33ef38cbb226e8bbc
2021-09-17 05:23:14 -07:00
Michel Weststrate
e771394350 Fix timeout handlers being shared across connections
Summary: If multiple apps connect simultanously, they could overwrite or cancel each other timeoutHandles, leading to potential incorrect messages.

Reviewed By: lblasa

Differential Revision: D31015171

fbshipit-source-id: 1d498a90c8a7a1847d2a961fc944d2f74e734cc2
2021-09-17 05:23:14 -07:00
Julio Cesar Sevarolli Assis
cbee595229 Enhancing types for Device
Summary: While investigating Flipper to unblock D30990411. I found this untyped `device` field. This field is exactly the `Device` type in 'adbkit', so I did a small refactor to type it.

Reviewed By: timur-valiev

Differential Revision: D30996427

fbshipit-source-id: 9972a865c2dee009088635e57ef512969f404ddf
2021-09-17 05:23:14 -07:00
Wenhuan Li
eb04011887 Limit ADB error display for 10 seconds
Summary: So that error message won't displayed forever.

Reviewed By: lblasa

Differential Revision: D30991434

fbshipit-source-id: 2cb5c9f983e11e021acb818ad4e245530757eee4
2021-09-16 07:02:06 -07:00
Michel Weststrate
9ebdf2e9ac Add warnings on how to handle offline emulators
Summary:
My emulators stopped showing up, but I noticed they were still listed in adb devices as 'offline'. Seems to be a weird ADB issue, changing the developer settings on the emulator fixed that for me, so linked to the SO answer where I found the solution.

Changelog: Added warning about offline emulators in ADB

Reviewed By: nikoant

Differential Revision: D30957786

fbshipit-source-id: 5468a983b5364c0fe868610978c09382f6b43d91
2021-09-16 02:22:31 -07:00
Michel Weststrate
8e899a90a4 Make sure the same client doesn't end up twice in the device list
Summary: Noticed in a support post that uninitialised devices could end up multiple times in the connecting list.

Reviewed By: timur-valiev

Differential Revision: D30957447

fbshipit-source-id: 11a2e3a9c52083245e66ebfb1899c00aeae6eb7e
2021-09-15 14:46:11 -07:00
Michel Weststrate
94a7b4360d add error handing to ADB client creation
Summary:
Noticed there are uncaught exception if adb cannot be found, that don't make it to the UI, but just cause no devices to be detected.

While testing, found that the unsafeClient fallback we use doesn't find the devices either. So it is unclear to me if it is helping in any case, and figured we'd better provide early signal to the user to set up adb correctly, rather than jumping through hoops and trying to work without it.

Changelog: Handle the absence of ADB better

Reviewed By: timur-valiev

Differential Revision: D30957220

fbshipit-source-id: 4d9a89bffefa96d3861d3f26224b4c74c19abd37
2021-09-15 14:46:11 -07:00
Lorenzo Blasa
1390bf4a33 Define alt ports for web socket connections
Summary:
The changes below add the notion of alternative ports to Flipper.

These alternative ports are meant to and will be used to connect via WebSocket instead of RSocket. The name does not suggest that as to make as generic as possible so that they can be reused for different purposes in the future.

Reviewed By: passy

Differential Revision: D30898874

fbshipit-source-id: 5eed8c61b41b502c859192aaac59c284b7b36228
2021-09-15 07:59:55 -07:00
Pascal Hartig
f522c9ee07 Fix Flipper lints #3
Summary: More error chaining and some error logging.

Reviewed By: lblasa

Differential Revision: D30932120

fbshipit-source-id: de0da698a24b04312b4df3c59b02d8d85d2d7e19
2021-09-14 08:55:28 -07:00
Wenhuan Li
384fd5ab1d Fix adb related warnings
Summary: Fix lint warnings

Reviewed By: passy

Differential Revision: D30929702

fbshipit-source-id: 8763783a7faf978f81087258fb6ef345d9abdbe4
2021-09-14 07:37:23 -07:00
Michel Weststrate
75b5783fd0 Clean up QPL integration
Summary:
Removed the Flipper QPL integration, see:
https://fb.workplace.com/groups/flippersupport/permalink/1200183003795689/

It complicates our build setup significantly, without actually being used anywhere for the past year. Apparently it doesn't solve a gap compared to the scuba logging we have already in place.

Reviewed By: passy

Differential Revision: D30911573

fbshipit-source-id: 836e2aba0c92c0eed9fed0dfb12bd8bdcb8c7d71
2021-09-14 02:55:01 -07:00
dependabot[bot]
4aac809e3a Bump async-mutex from 0.3.1 to 0.3.2 in /desktop (#2856)
Summary:
Bumps [async-mutex](https://github.com/DirtyHairy/async-mutex) from 0.3.1 to 0.3.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/DirtyHairy/async-mutex/blob/master/CHANGELOG.md">async-mutex's changelog</a>.</em></p>
<blockquote>
<h2>0.3.2</h2>
<ul>
<li>Add <code>waitForUnlock</code> for waiting until a mutex/semaphore is free for locking,
thanks to Jason Gore.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="0acc02c7eb"><code>0acc02c</code></a> Changelog.</li>
<li><a href="60563942d2"><code>6056394</code></a> Bump version.</li>
<li><a href="14f9f58939"><code>14f9f58</code></a> Documentation.</li>
<li><a href="92a1cacfcb"><code>92a1cac</code></a> Dependency bump.</li>
<li><a href="5fd5b7b890"><code>5fd5b7b</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/DirtyHairy/async-mutex/issues/43">https://github.com/facebook/flipper/issues/43</a> from JMounier/master</li>
<li><a href="7b022d28f9"><code>7b022d2</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/DirtyHairy/async-mutex/issues/47">https://github.com/facebook/flipper/issues/47</a> from JasonGore/jagore/waitforunlock</li>
<li><a href="dc839defa0"><code>dc839de</code></a> Do some cleanup and add Mutex tests.</li>
<li><a href="747cd7375f"><code>747cd73</code></a> Add waitForUnlock function to Semaphore and Mutex.</li>
<li><a href="4858eb7700"><code>4858eb7</code></a> fix tryAcquire README example</li>
<li><a href="d536a3313f"><code>d536a33</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/DirtyHairy/async-mutex/issues/37">https://github.com/facebook/flipper/issues/37</a> from kronthto/patch-1</li>
<li>Additional commits viewable in <a href="https://github.com/DirtyHairy/async-mutex/compare/v0.3.1...v0.3.2">compare view</a></li>
</ul>
</details>
<br />

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

Reviewed By: timur-valiev, fabiomassimo

Differential Revision: D30900779

Pulled By: mweststrate

fbshipit-source-id: c8b2328a467aa93402d41dee10a7f2f57622bc7a
2021-09-13 15:05:56 -07:00
dependabot[bot]
a44876a459 Bump axios from 0.21.1 to 0.21.2 in /desktop (#2844)
Summary:
Bumps [axios](https://github.com/axios/axios) from 0.21.1 to 0.21.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/axios/axios/releases">axios's releases</a>.</em></p>
<blockquote>
<h2>v0.21.2</h2>
<h3>0.21.2 (September 4, 2021)</h3>
<p>Fixes and Functionality:</p>
<ul>
<li>Updating axios requests to be delayed by pre-emptive promise creation (<a href="https://github-redirect.dependabot.com/axios/axios/pull/2702">https://github.com/facebook/flipper/issues/2702</a>)</li>
<li>Adding &quot;synchronous&quot; and &quot;runWhen&quot; options to interceptors api (<a href="https://github-redirect.dependabot.com/axios/axios/pull/2702">https://github.com/facebook/flipper/issues/2702</a>)</li>
<li>Updating of transformResponse (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3377">#3377</a>)</li>
<li>Adding ability to omit User-Agent header (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3703">#3703</a>)</li>
<li>Adding multiple JSON improvements (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3688">#3688</a>, <a href="https://github-redirect.dependabot.com/axios/axios/pull/3763">#3763</a>)</li>
<li>Fixing quadratic runtime and extra memory usage when setting a maxContentLength (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3738">#3738</a>)</li>
<li>Adding parseInt to config.timeout (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3781">#3781</a>)</li>
<li>Adding custom return type support to interceptor (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3783">#3783</a>)</li>
<li>Adding security fix for ReDoS vulnerability (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3980">#3980</a>)</li>
</ul>
<p>Internal and Tests:</p>
<ul>
<li>Updating build dev dependancies (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3401">#3401</a>)</li>
<li>Fixing builds running on Travis CI (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3538">#3538</a>)</li>
<li>Updating follow rediect version (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3694">#3694</a>, <a href="https://github-redirect.dependabot.com/axios/axios/pull/3771">#3771</a>)</li>
<li>Updating karma sauce launcher to fix failing sauce tests (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3712">#3712</a>, <a href="https://github-redirect.dependabot.com/axios/axios/pull/3717">#3717</a>)</li>
<li>Updating content-type header for application/json to not contain charset field, according do RFC 8259 (<a href="https://github-redirect.dependabot.com/axios/axios/pull/2154">https://github.com/facebook/flipper/issues/2154</a>)</li>
<li>Fixing tests by bumping karma-sauce-launcher version (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3813">#3813</a>)</li>
<li>Changing testing process from Travis CI to GitHub Actions (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3938">#3938</a>)</li>
</ul>
<p>Documentation:</p>
<ul>
<li>Updating documentation around the use of <code>AUTH_TOKEN</code> with multiple domain endpoints (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3539">#3539</a>)</li>
<li>Remove duplication of item in changelog (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3523">#3523</a>)</li>
<li>Fixing gramatical errors (<a href="https://github-redirect.dependabot.com/axios/axios/pull/2642">https://github.com/facebook/flipper/issues/2642</a>)</li>
<li>Fixing spelling error (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3567">#3567</a>)</li>
<li>Moving gitpod metion (<a href="https://github-redirect.dependabot.com/axios/axios/pull/2637">https://github.com/facebook/flipper/issues/2637</a>)</li>
<li>Adding new axios documentation website link (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3681">#3681</a>, <a href="https://github-redirect.dependabot.com/axios/axios/pull/3707">#3707</a>)</li>
<li>Updating documentation around dispatching requests (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3772">#3772</a>)</li>
<li>Adding documentation for the type guard isAxiosError (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3767">#3767</a>)</li>
<li>Adding explanation of cancel token (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3803">#3803</a>)</li>
<li>Updating CI status badge (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3953">#3953</a>)</li>
<li>Fixing errors with JSON documentation (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3936">#3936</a>)</li>
<li>Fixing README typo under Request Config (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3825">#3825</a>)</li>
<li>Adding axios-multi-api to the ecosystem file (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3817">#3817</a>)</li>
<li>Adding SECURITY.md to properly disclose security vulnerabilities (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3981">#3981</a>)</li>
</ul>
<p>Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:</p>
<ul>
<li><a href="https://github.com/axios/axios/blob/HEAD/mailto:jasonsaayman@gmail.com">Jay</a></li>
<li><a href="https://github.com/SashaKoro">Sasha Korotkov</a></li>
<li><a href="https://github.com/timemachine3030">Daniel Lopretto</a></li>
<li><a href="https://github.com/MikeBishop">Mike Bishop</a></li>
<li><a href="https://github.com/DigitalBrainJS">Dmitriy Mozgovoy</a></li>
<li><a href="https://github.com/bimbiltu">Mark</a></li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/axios/axios/blob/master/CHANGELOG.md">axios's changelog</a>.</em></p>
<blockquote>
<h3>0.21.2 (September 4, 2021)</h3>
<p>Fixes and Functionality:</p>
<ul>
<li>Updating axios requests to be delayed by pre-emptive promise creation (<a href="https://github-redirect.dependabot.com/axios/axios/pull/2702">https://github.com/facebook/flipper/issues/2702</a>)</li>
<li>Adding &quot;synchronous&quot; and &quot;runWhen&quot; options to interceptors api (<a href="https://github-redirect.dependabot.com/axios/axios/pull/2702">https://github.com/facebook/flipper/issues/2702</a>)</li>
<li>Updating of transformResponse (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3377">#3377</a>)</li>
<li>Adding ability to omit User-Agent header (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3703">#3703</a>)</li>
<li>Adding multiple JSON improvements (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3688">#3688</a>, <a href="https://github-redirect.dependabot.com/axios/axios/pull/3763">#3763</a>)</li>
<li>Fixing quadratic runtime and extra memory usage when setting a maxContentLength (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3738">#3738</a>)</li>
<li>Adding parseInt to config.timeout (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3781">#3781</a>)</li>
<li>Adding custom return type support to interceptor (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3783">#3783</a>)</li>
<li>Adding security fix for ReDoS vulnerability (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3980">#3980</a>)</li>
</ul>
<p>Internal and Tests:</p>
<ul>
<li>Updating build dev dependancies (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3401">#3401</a>)</li>
<li>Fixing builds running on Travis CI (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3538">#3538</a>)</li>
<li>Updating follow rediect version (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3694">#3694</a>, <a href="https://github-redirect.dependabot.com/axios/axios/pull/3771">#3771</a>)</li>
<li>Updating karma sauce launcher to fix failing sauce tests (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3712">#3712</a>, <a href="https://github-redirect.dependabot.com/axios/axios/pull/3717">#3717</a>)</li>
<li>Updating content-type header for application/json to not contain charset field, according do RFC 8259 (<a href="https://github-redirect.dependabot.com/axios/axios/pull/2154">https://github.com/facebook/flipper/issues/2154</a>)</li>
<li>Fixing tests by bumping karma-sauce-launcher version (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3813">#3813</a>)</li>
<li>Changing testing process from Travis CI to GitHub Actions (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3938">#3938</a>)</li>
</ul>
<p>Documentation:</p>
<ul>
<li>Updating documentation around the use of <code>AUTH_TOKEN</code> with multiple domain endpoints (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3539">#3539</a>)</li>
<li>Remove duplication of item in changelog (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3523">#3523</a>)</li>
<li>Fixing gramatical errors (<a href="https://github-redirect.dependabot.com/axios/axios/pull/2642">https://github.com/facebook/flipper/issues/2642</a>)</li>
<li>Fixing spelling error (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3567">#3567</a>)</li>
<li>Moving gitpod metion (<a href="https://github-redirect.dependabot.com/axios/axios/pull/2637">https://github.com/facebook/flipper/issues/2637</a>)</li>
<li>Adding new axios documentation website link (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3681">#3681</a>, <a href="https://github-redirect.dependabot.com/axios/axios/pull/3707">#3707</a>)</li>
<li>Updating documentation around dispatching requests (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3772">#3772</a>)</li>
<li>Adding documentation for the type guard isAxiosError (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3767">#3767</a>)</li>
<li>Adding explanation of cancel token (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3803">#3803</a>)</li>
<li>Updating CI status badge (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3953">#3953</a>)</li>
<li>Fixing errors with JSON documentation (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3936">#3936</a>)</li>
<li>Fixing README typo under Request Config (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3825">#3825</a>)</li>
<li>Adding axios-multi-api to the ecosystem file (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3817">#3817</a>)</li>
<li>Adding SECURITY.md to properly disclose security vulnerabilities (<a href="https://github-redirect.dependabot.com/axios/axios/pull/3981">#3981</a>)</li>
</ul>
<p>Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:</p>
<ul>
<li><a href="https://github.com/axios/axios/blob/master/mailto:jasonsaayman@gmail.com">Jay</a></li>
<li><a href="https://github.com/SashaKoro">Sasha Korotkov</a></li>
<li><a href="https://github.com/timemachine3030">Daniel Lopretto</a></li>
<li><a href="https://github.com/MikeBishop">Mike Bishop</a></li>
<li><a href="https://github.com/DigitalBrainJS">Dmitriy Mozgovoy</a></li>
<li><a href="https://github.com/bimbiltu">Mark</a></li>
<li><a href="https://github.com/piiih">Philipe Gouveia Paixão</a></li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="c0c8761091"><code>c0c8761</code></a> [Updating] changelog to include links to issues and contributors</li>
<li><a href="619bb465da"><code>619bb46</code></a> [Releasing] v0.21.2</li>
<li><a href="82c9455591"><code>82c9455</code></a> Create SECURITY.md (<a href="https://github-redirect.dependabot.com/axios/axios/issues/3981">#3981</a>)</li>
<li><a href="5b457116e3"><code>5b45711</code></a> Security fix for ReDoS (<a href="https://github-redirect.dependabot.com/axios/axios/issues/3980">#3980</a>)</li>
<li><a href="5bc9ea24dd"><code>5bc9ea2</code></a> Update ECOSYSTEM.md (<a href="https://github-redirect.dependabot.com/axios/axios/issues/3817">#3817</a>)</li>
<li><a href="e72813a385"><code>e72813a</code></a> Fixing README.md  (<a href="https://github-redirect.dependabot.com/axios/axios/issues/3818">#3818</a>)</li>
<li><a href="e10a0270e9"><code>e10a027</code></a> Fix README typo under Request Config (<a href="https://github-redirect.dependabot.com/axios/axios/issues/3825">#3825</a>)</li>
<li><a href="e091491127"><code>e091491</code></a> Update README.md (<a href="https://github-redirect.dependabot.com/axios/axios/issues/3936">#3936</a>)</li>
<li><a href="b42fbad57b"><code>b42fbad</code></a> Removed un-needed bracket</li>
<li><a href="520c8dccde"><code>520c8dc</code></a> Updating CI status badge (<a href="https://github-redirect.dependabot.com/axios/axios/issues/3953">#3953</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/axios/axios/compare/v0.21.1...v0.21.2">compare view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a href="https://www.npmjs.com/~jasonsaayman">jasonsaayman</a>, a new releaser for axios since your current version.</p>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=axios&package-manager=npm_and_yarn&previous-version=0.21.1&new-version=0.21.2)](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)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/facebook/flipper/network/alerts).

</details>

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

Reviewed By: timur-valiev

Differential Revision: D30897714

Pulled By: passy

fbshipit-source-id: c9afcbd13f2ded0531cc33ee885332f547dca5fc
2021-09-13 03:16:00 -07:00
Pascal Hartig
1b8da297e3 Fix Flipper lints #2
Summary: Per title.

Reviewed By: timur-valiev

Differential Revision: D30843077

fbshipit-source-id: 1a3f4757518610b8caf41c62af7e27723d0de8d6
2021-09-13 02:32:07 -07:00
Lorenzo Blasa
977cc7598e RSocket and WebSocket
Summary:
Enable Flipper Desktop to run both RSocket and WebSocket servers.

I've used 'alt' ports and/or server instead of tying the name explicitly to web sockets. This more general approach can be used later on to supply and use an alternative socket pair for other usages.

Reviewed By: fabiomassimo

Differential Revision: D30482531

fbshipit-source-id: a2c5f25b925c731e7970614b5ed987ce00219918
2021-09-10 10:06:05 -07:00
Michel Weststrate
f9c8bf8941 Fix dark mode startup error
Summary:
Changelog: Fixed startup error when loading default theme

The theme defaulted to `auto`, instead of `system`, causing an startup exception. Fixed by adding types and having a more defensive startup check.

Fixes https://github.com/facebook/flipper/issues/2835

Reviewed By: jknoxville

Differential Revision: D30866648

fbshipit-source-id: 83b6d9fc235eaa0a7e959df4276d3f378eed7d1f
2021-09-10 07:04:43 -07:00
Michel Weststrate
80f48b444c Fix pending connections for websocket browser connections
Summary:
Connections from VSCode and Kite would remain forever pending because they don't go through the secure connection handler. This diff fixes that. Also removed the separate event that existed for that, since registering a new client is already a 'success' signal, so it doesn't need a separate event.

It turned out that the VSCode pending connection is actually correct, as it never handles the `getPlugins` event, so apparently the handling is broken. Added timeouts to guard against that as well.

Applied several code simplications as well.

Introduced an explicit cert exchange medium 'NONE' so that in code it is a bit clearer where CSR negotiation is supposed to happen.

Changelog: Fixed an issue where Kite / Unity apps didn't connect anymore

Reviewed By: timur-valiev

Differential Revision: D30866301

fbshipit-source-id: 8bd214fd9eebcd9a7583f1b44ee283883002f62e
2021-09-10 07:04:43 -07:00
Michel Weststrate
d8f77db632 Code improvements and more logging on connection handling
Summary:
In an attempt to trace Android issues:

1. added more logging to the process (opted for info level for now since this is pretty critical for support requests, yet not super repetitive overall. We could maybe turn it into usage tracking at some point to have central stats?).
2. rewrote promise chains to async/await since they are easier to follow and harder to do accidentally wrong
3. fixed some minor potential problems, will highlights those in code.

Changelog: Improved handling of edge cases in certificate exchange, which should address cases where a Flipper connection wouldn't come up when connection to Android / IOS. Added explicit logging around connection negation.

Reviewed By: lblasa

Differential Revision: D30838947

fbshipit-source-id: a898c6d3be6edc22bd24f9d2bad76e81871360da
2021-09-10 07:04:43 -07:00
Ananya Arun
0816f73d07 Start abstractions for the guide
Summary:
This is the third diff for M3

- Started abstractions to remove repetitive code as a part of M3
- Implemented a new abstracted component in GuideAnserScreen and removed PluginErrored.tsx to integrate it here.
- Using a map object that maps a string to function. Here I have used helper functions to get each screens context as first class members.
- The map is global and is populated globally (as discussed) and we invoke the required function based on the state we are at from GuideAnswerScreen.

Reviewed By: mweststrate

Differential Revision: D30772236

fbshipit-source-id: f8fc175c6d308e2f72c5f6ce826f70245ad46797
2021-09-10 06:28:07 -07:00
Michel Weststrate
9f7b7885e3 Move interaction logs from info to debug
Summary: per title, the logs (e.g. `[interaction] "clear" clicked in 3ms.`) are not super interesting, unless you're trying to build some scuba graphs

Reviewed By: timur-valiev

Differential Revision: D30839590

fbshipit-source-id: d22deec130f947d2d440d499b8e2e146c1b44b68
2021-09-09 07:01:04 -07:00
Michel Weststrate
946fc56b70 Don't eat exceptions
Summary:
if a resolved client doesn't become available, we were eating the exception. This diff changes that, as exceptions might actually occur (e.g. a timeout, indicating that for example the device didn't become available, which points out a bug in the example below).

We might now over report some issues, causing regressions in our monitoring, but let's work from there.

Reviewed By: timur-valiev

Differential Revision: D30806511

fbshipit-source-id: 09d62bd7c41439aa452b6df501426e239559eba2
2021-09-08 09:59:38 -07:00
Pascal Hartig
47099cfd31 Fix Flipper lints #16
Summary: Larger list of fixes. Adding another package to the flipper export is a bit nasty but it unblocks us for now and centralises `remote` access which seems like a win for FAAS.

Reviewed By: mweststrate

Differential Revision: D30785421

fbshipit-source-id: 931297e8566b5d8a213b69ae87d0cda7648b3ed4
2021-09-08 08:44:19 -07:00
Pascal Hartig
262cd6105b Fix Flipper lints #5
Summary: A few more lints. Some already got fixed since the task was created.

Reviewed By: timur-valiev

Differential Revision: D30782192

fbshipit-source-id: 2d03d24034173d632280035e6ba68f485fbe62f3
2021-09-08 08:44:19 -07:00
ZHANG Qichuan
9a4d94c971 Add option for automatic dark theme (#2759)
Summary:
Add an setting option to allow automatic dark theme

A feature requested by swrobel https://github.com/facebook/flipper/issues/2708

## Changelog

### UI change
Replace the `Enable Dark Theme` Toggle button with a Radio group containing three Radio buttons.

The available options are `Dark`, `Light` and `Use System Default`, of which `Use System Default` is the default value

<img width="548" alt="Screenshot 2021-08-31 at 3 32 44 PM" src="https://user-images.githubusercontent.com/410850/131462798-4e74f757-41fc-4a3f-ba28-53d00fc1cf03.png">

### Data structure change

The `darkMode` property of [Settings](c0cd32564a/desktop/app/src/reducers/settings.tsx (L20)) is changed from `boolean` to `string`, the available values are `dark`, `light` and `auto`

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

Test Plan:
### Test 1
- Step: Choose `Dark` in the Settings page and click on `Apply and Restart` button
- Expect: The application is displayed in Dark mode
### Test 2
- Step: Choose `Light` in the Settings page and click on `Apply and Restart` button
- Expect: The application is displayed in Light mode
### Test 3
- Step: Choose `Use System Default` in the Settings page and click on `Apply and Restart` button
- Expect: The application is displayed in System Default mode

Reviewed By: mweststrate

Differential Revision: D30666966

Pulled By: passy

fbshipit-source-id: a63e91f2d0dbff96890e267062cb75bffd0007f4
2021-09-08 03:28:35 -07:00
Pascal Hartig
c05feb4f2b Fix file extension
Summary: A stray `.ts` in a `.tsx` world.

Reviewed By: lblasa

Differential Revision: D30774439

fbshipit-source-id: 69b570c85c4076fc523328323a5cbb6f770c95d2
2021-09-07 07:31:29 -07:00
Pascal Hartig
e2122e395b Fix Flipper lints #1
Summary: More lints.

Reviewed By: lblasa

Differential Revision: D30769201

fbshipit-source-id: 38089363ffb894171d386eaa80055c5d8d59500f
2021-09-07 07:31:29 -07:00
Pascal Hartig
e25103291a Fix Flipper lints #4
Summary: Fixing 10 lints.

Reviewed By: lblasa

Differential Revision: D30769155

fbshipit-source-id: 5841ef7403dfff5fc7779789106b9bdc3719ce49
2021-09-07 07:31:29 -07:00
Pascal Hartig
2d3f56ef8d Fix Flipper lints #0
Summary: Fix all lints from T98764173.

Reviewed By: timur-valiev

Differential Revision: D30767919

fbshipit-source-id: 4b0f4b925e246f4fb41d71a323d51fb0e940869d
2021-09-07 03:57:46 -07:00