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
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
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
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
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
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
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
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
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
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
Summary:
Bumps [ws](https://github.com/websockets/ws) from 7.5.3 to 8.2.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/websockets/ws/releases">ws's releases</a>.</em></p>
<blockquote>
<h2>8.2.1</h2>
<h1>Bug fixes</h1>
<ul>
<li>Fixed an issue where the socket was not resumed, preventing the connection
from being closed cleanly (869c9892).</li>
</ul>
<h2>8.2.0</h2>
<h1>Features</h1>
<ul>
<li>Added <code>WebSocket.WebSocket</code> as an alias for <code>WebSocket</code> and
<code>WebSocket.WebSocketServer</code> as an alias for <code>WebSocket.Server</code> to fix name
consistency and improve interoperability with the ES module wrapper (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1935">https://github.com/facebook/flipper/issues/1935</a>).</li>
</ul>
<h2>8.1.0</h2>
<h1>Features</h1>
<ul>
<li>Added ability to skip UTF-8 validation (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1928">https://github.com/facebook/flipper/issues/1928</a>).</li>
</ul>
<h1>Bug fixes</h1>
<ul>
<li>Fixed an issue with a breaking change in Node.js master (6a72da3e).</li>
<li>Fixed a misleading error message (c95e695d).</li>
</ul>
<h2>8.0.0</h2>
<h1>Breaking changes</h1>
<ul>
<li>
<p>The <code>WebSocket</code> constructor now throws a <code>SyntaxError</code> if any of the
subprotocol names are invalid or duplicated (0aecf0c9).</p>
</li>
<li>
<p>The server now aborts the opening handshake if an invalid
<code>Sec-WebSocket-Protocol</code> header field value is received (1877ddeb).</p>
</li>
<li>
<p>The <code>protocols</code> argument of <code>handleProtocols</code> hook is no longer an <code>Array</code> but
a <code>Set</code> (1877ddeb).</p>
</li>
<li>
<p>The opening handshake is now aborted if the <code>Sec-WebSocket-Extensions</code> header
field value is empty or it begins or ends with a white space (e814110e).</p>
</li>
<li>
<p>Dropped support for Node.js < 10.0.0 (552b5067).</p>
</li>
<li>
<p>The <code>WebSocket</code> constructor now throws a <code>SyntaxError</code> if the connection URL
contains a fragment identifier or if the URL's protocol is not one of <code>'ws:'</code>,
<code>'wss:'</code>, or <code>'ws+unix:'</code> (ebea038f).</p>
</li>
<li>
<p>Text messages and close reasons are no longer decoded to strings. They are
passed as <code>Buffer</code>s to the listeners of their respective events. The listeners
of the <code>'message'</code> event now take a boolean argument specifying whether or not
the message is binary (e173423c).</p>
<p>Existing code can be migrated by decoding the buffer explicitly.</p>
<pre lang="js"><code>websocket.on('message', function message(data, isBinary) {
const message = isBinary ? data : data.toString();
// Continue as before.
});
</code></pre>
</li>
</ul>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="cc7a7798b7"><code>cc7a779</code></a> [dist] 8.2.1</li>
<li><a href="869c9892cd"><code>869c989</code></a> [fix] Resume the socket in the next tick</li>
<li><a href="ea6c054e97"><code>ea6c054</code></a> [test] Reorganize some tests</li>
<li><a href="7647a8920b"><code>7647a89</code></a> [dist] 8.2.0</li>
<li><a href="d5e3549a03"><code>d5e3549</code></a> [minor] Add <code>WebSocket.WebSocket{,Server}</code> aliases (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1935">https://github.com/facebook/flipper/issues/1935</a>)</li>
<li><a href="c677aab978"><code>c677aab</code></a> [doc] Fix <code>createWebSocketStream()</code> documentation</li>
<li><a href="f38247e5e0"><code>f38247e</code></a> [doc] Sort options alphabetically</li>
<li><a href="142f0911b5"><code>142f091</code></a> [dist] 8.1.0</li>
<li><a href="d21c81034f"><code>d21c810</code></a> [feature] Add ability to skip UTF-8 validation (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1928">https://github.com/facebook/flipper/issues/1928</a>)</li>
<li><a href="9bd3bd1251"><code>9bd3bd1</code></a> [minor] Fix typo (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1929">https://github.com/facebook/flipper/issues/1929</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/websockets/ws/compare/7.5.3...8.2.1">compare view</a></li>
</ul>
</details>
<br />
[](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/2756
Reviewed By: lblasa
Differential Revision: D30727123
Pulled By: passy
fbshipit-source-id: b06ab55427b7798d004d2f3371f76bda6af69947
Summary: Based on afcoplan's feedback, now we're showing a button for launching the emulators instead of having it inline.
Reviewed By: mweststrate
Differential Revision: D30603659
fbshipit-source-id: edae6c63fd58647b406398c897215910938ae429
Summary:
Remove IPC rendering / connection implementation. This has been behind GK for a couple of weeks, and no one complained / white listed. See also D30367413.
flipper_js_client_emulator
Reviewed By: passy
Differential Revision: D30452442
fbshipit-source-id: fbe7b4914fecc023f3ec78a027106ea32c5a99bd
Summary:
From what I can tell, `idb file pull` seems to behave slightly differently for simulators. When pulling from a remote simulator, it appears to first create a directory for the local destination causing the read in line 508 to as it is trying to read the *folder* `app.csr` not `app.csr/app.csr`.
By omitting the destination file name, we avoid this behaviour.
Reviewed By: fabiomassimo
Differential Revision: D30541778
fbshipit-source-id: 851398aed5fd350a68ba0686707ce0f0aa09672c
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2736
This should fix a bunch of open dependabot issues on GitHub.
Reviewed By: fabiomassimo
Differential Revision: D30539761
fbshipit-source-id: b355d41336b3b1d85b50fb0736fc1b33b12e83d0
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2735
GitHub has been failing because an ant patch no longer applies.
Reviewed By: jknoxville
Differential Revision: D30539463
fbshipit-source-id: b16b4d04a366a4af8d0efe36856a4b565aeeecbd
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2734
This diff is the third out of n for the troubleshooting guide for flipper.
What has been done -
- Added autodetect and select for devices and apps. The user can now select these from the dropdown.
- Added functions to get failed plugins from the store and the list of available plugins and their details.
- This data will be used in future diffs to preprocess which state/question to redirect the user to.
- Unit tests for this section will be added once the preprocessing is completed in the next diff. Right now the function just returns the plugin name itself. It will essentially return the state to toggle to in the future.
NOTE - The location of the guide on the first screen of flipper has also been moved after discussion. The guide is now always open to select irrespective of devices connecting or not.
Presently this is how the button is rendered.
- Public build/ internal build when user is not in allowlist of the gatekeeper
{F655248582}
It does not appear in the public build once a device is detected
{F655248769}
- Internal build when user is in the allowlist
{F655249521}
Reviewed By: passy
Differential Revision: D30450347
fbshipit-source-id: 68b4b311e913ebd82055acf7a3a581825246f4ed
Summary:
allow-large-files
Only patch bumps of >1.0.0, should be safe.
Reviewed By: jknoxville
Differential Revision: D30482302
fbshipit-source-id: b5f331822ba6931b6e5f68190c7d50c62611a153
Summary:
Some of them got re-introduced after rebasing D30411434 (f60429cab5).
Soz for not checking the rebase result carefully enough.
Reviewed By: mweststrate
Differential Revision: D30450602
fbshipit-source-id: 6c45422f7f9e34419949cec936ffffbdf1c652a4
Summary:
This diff makes the new deeplink format feature complete, make sure VPN connection, plugin installation, client & device selection are now all handled. See the test plan for examples.
Changelog: Flipper now supports a richer protocol for opening deeplinks: https://fbflipper.com/docs/extending/deeplinks#open-plugin
Reviewed By: timur-valiev
Differential Revision: D30423809
fbshipit-source-id: e6cf4bf852b2c64e9a79a33ef0842eb27f68f840
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2706
Creating a CertificateProvider in test had the side effect of generating certificate files, which fails in windows CI. This change makes sure the files aren't generated in test. See https://github.com/facebook/flipper/runs/3366318523.
Since it is not possible to start the flipper server 'physically' without writing file (for the secure server), figured to remove the test entirely, since there is high impact but little risk captured by it; if the server doesn't start, *any* manual / exploratory test will fail.
Reviewed By: lblasa
Differential Revision: D30423173
fbshipit-source-id: e411cc61df04120a7132983e9f8d3d140e4ca048
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2703
- This diff reverts the following diff - D30393320 (75c4f20c8a)
- Moved the tests to 'fb/__tests__' . Previously they were not under fb which was causing the github version to break
- Also moved all the troubleshooting guide components into the fb/ directory under appinspect
Reviewed By: passy
Differential Revision: D30393785
fbshipit-source-id: caf3680c542eb9ca3c6f817c5a69d533245cf304
Summary:
Linter flagged this as it's using promises inside
promises. This is a bit easier to read.
Reviewed By: timur-valiev
Differential Revision: D30402783
fbshipit-source-id: aee7dedc4468538bceec4fc64379f8b2d89a660c
Summary:
This diff is the first out of n for the troubleshooting guide for flipper.
What has been done -
- Defined a structure for the troubleshooting guide in TroubleshootingGuide.tsx (parent component ) to render children components or the individual questions from here.
- The initial screen of the trouble shooting guide along with the 3 sections of questions users face. Clicking them prompts to individual question screens that will be built in future diffs.
- Units tests in jest for the rendering of the screens and functions.
Reviewed By: mweststrate
Differential Revision: D30279739
fbshipit-source-id: 3e317b67e5ac461902c6779eaa584e1032741b85
Summary: Made a start with decoupling JS device. Incomplete as there are still Electron deps.
Reviewed By: timur-valiev
Differential Revision: D30309257
fbshipit-source-id: b8002170cbbe8d68e1795ce7c12ffce4c8eac853
Summary: Decoupled metro 'device' from Redux store. Extracting some commonalities with Android device management up into FlipperServer
Reviewed By: timur-valiev
Differential Revision: D30309256
fbshipit-source-id: 1a9ac01e3f21d2d08761554d3644a7ae8d00a93e
Summary: See earlier diffs in the stack. This diff decouple android device management from the Redux store, replacing it with specific events.
Reviewed By: timur-valiev
Differential Revision: D30286345
fbshipit-source-id: 42f52056bf123b862e2fc087f2e7130c02bdd742
Summary:
This diff takes care of current plugin status when handling deeplinks. It checks:
1. if the plugin failed to load
2. if the plugin is behind GK
3. if the plugin is installable from bundle
4. if the plugin is installable from marketplace
Reviewed By: passy
Differential Revision: D29875483
fbshipit-source-id: 8dac1aab63822f43a0d002b10efa5b4a756fce41
Summary: We're currently getting errors for every duplicate key and can't easily unify them, so we're adding the additional information to a warning instead.
Reviewed By: mweststrate
Differential Revision: D30337821
fbshipit-source-id: db9dc44d7d3424de169bed9b4447b482e411eb19
Summary:
This works for forwarded as well as local devices.
There is a bunch more unification work that needs to be done here as we currently have three completely different ways of querying iOS devices. More on that next week.
Reviewed By: jknoxville
Differential Revision: D30308405
fbshipit-source-id: c58ac73e971ce2cc4da92e9508bc05dff9c1a95a
Summary:
Moved all logic per device type we support to its own dir, including tools and utilities around it, which makes it easier to consolidate logic and decouple in turn per device type.
Per type, all logic can be found in
`server/devices/(desktop|metro|android|ios|webapp)`
Reviewed By: timur-valiev
Differential Revision: D30277817
fbshipit-source-id: 2b5339c363d5d31ceeba07cec03826fc67cf3748
Summary: This diff moves the first small pieces of getting device detection up and running to `server/`, and the wiring between FlipperServer and flipper core / redux is setting up specific events and dispatch actions from there.
Reviewed By: timur-valiev
Differential Revision: D30276776
fbshipit-source-id: b30b996d03c27459815bebeb97b05b5fe5d24bec
Summary: idb has a command for doing the same now.
Reviewed By: timur-valiev
Differential Revision: D30277192
fbshipit-source-id: eb46cdc7a7218077a7da90f6182d5f17bfcc758a