Summary:
Noticed in a bug report that the read value was `[object Promise]`.
This wasn't a huge issue before because the worst case was that when writing settings, it would replace them again with the defaults, but still not great.
Reviewed By: mweststrate
Differential Revision: D32181718
fbshipit-source-id: cf6cd7aa3bd823845d6657c5466fbcdef6adac28
Summary:
Ugh, VS Code blocked on the formatter and didn't include these
in my previous commit.
Reviewed By: mweststrate
Differential Revision: D32179985
fbshipit-source-id: e8cf178996bc3b468c88023a5c48e69271758e07
Summary:
1. Added a text label similar to the launch screen that tells user the release channel they are using.
2. Show a different coloured logo when the user is using the "Insiders" channel.
I have tried to keep the style as similar to the launch screen as possible for consistency.
Reviewed By: passy
Differential Revision: D32169268
fbshipit-source-id: f119a379fce983d9df765ede94148a4deaa31c9c
Summary:
In the left App Inspect sidebar on Flipper there were two warning messages
- "no devices found"
- "no application selected"
As there can be no application selected, while no device is active, this change removes the "no application selected" warning. Resulting in only showing one warning at a time.
As I am not familiar with all the states, nor what kind of devices or applications can exist in detail, I have moved up the logic to show the "no device found" message. Then reused it for the "no application selected" visibility.
In case the upper device list can show "connecting" without an actual device in the list, the "no application selected" message will be shown.
Reviewed By: passy
Differential Revision: D32139077
fbshipit-source-id: 06456e81fbe1f86d65f9aba598ee84ed8cd6b043
Summary:
This diff removes most remaining Electron imports, by storing env and path constants on the RenderHost. As nice side effect those paths are all cached now as well.
To make sure RenderHost is initialised before Flipper itself, forced loading Flipper through a require. Otherwise the setup is super sensitive to circular import statements, since a lot of module initialisation code depends on those paths / env vars.
Reviewed By: nikoant
Differential Revision: D31992230
fbshipit-source-id: 91beb430902272aaf4b051b35cdf12d2fc993347
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
Summary: Removed the usage of electron's native context menus, and replaces it with Antd based context menu's.
Reviewed By: passy
Differential Revision: D31990756
fbshipit-source-id: 0312cbac5fd20a1a30603ce1058c03f4291b23b1
Summary:
Bumps [ws](https://github.com/websockets/ws) from 7.5.5 to 8.2.3.
<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.3</h2>
<h1>Bug fixes</h1>
<ul>
<li>When context takeover is enabled, messages are now compressed even if their size
is below the value of the <code>perMessageDeflate.threshold</code> option (41ae5631).</li>
</ul>
<h2>8.2.2</h2>
<h1>Bug fixes</h1>
<ul>
<li>Some closing operations are now run only if needed (ec9377ca).</li>
</ul>
<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>The <code>WebSocket</code> constructor now throws a <code>SyntaxError</code> if any of the
subprotocol names are invalid or duplicated (0aecf0c9).</li>
<li>The server now aborts the opening handshake if an invalid
<code>Sec-WebSocket-Protocol</code> header field value is received (1877ddeb).</li>
<li>The <code>protocols</code> argument of <code>handleProtocols</code> hook is no longer an <code>Array</code> but
a <code>Set</code> (1877ddeb).</li>
<li>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).</li>
<li>Dropped support for Node.js < 10.0.0 (552b5067).</li>
<li>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).</li>
<li>Text messages and close reasons are no longer decoded to strings. They are</li>
</ul>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="cfd99b6309"><code>cfd99b6</code></a> [dist] 8.2.3</li>
<li><a href="fef7942a18"><code>fef7942</code></a> [ci] Fix typo</li>
<li><a href="41ae56313b"><code>41ae563</code></a> [fix] Ignore the <code>threshold</code> option if context takeover is enabled</li>
<li><a href="474aa3616f"><code>474aa36</code></a> [doc] Improve <code>WebSocket#{p{i,o}ng,send}()</code> documentation</li>
<li><a href="055949fd23"><code>055949f</code></a> [doc] Remove no longer needed noop function from code snippet</li>
<li><a href="5b85322f54"><code>5b85322</code></a> [ci] Update coverallsapp/github-action action to version 1.1.3</li>
<li><a href="f871195c55"><code>f871195</code></a> [doc] Update issue template</li>
<li><a href="72296e54ca"><code>72296e5</code></a> [dist] 8.2.2</li>
<li><a href="3039b6b9d2"><code>3039b6b</code></a> [doc] Change label text to CI</li>
<li><a href="04c032c51b"><code>04c032c</code></a> [ci] Use Github Actions for Windows x86 testing</li>
<li>Additional commits viewable in <a href="https://github.com/websockets/ws/compare/7.5.5...8.2.3">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/3004
Reviewed By: passy
Differential Revision: D31991546
Pulled By: cekkaewnumchai
fbshipit-source-id: 029092fa88e0c4a0816574c6c18e5565b9650615
Summary:
This introduces a few more lints in fact because I renamed the icon functions
to make clear that they use sync methods under the hood.
Reviewed By: timur-valiev
Differential Revision: D31964701
fbshipit-source-id: d0beb58b5b301f5428fdbfe8c65784df0d86eaad
Summary: Mostly ignoring things in this one because it's tests.
Reviewed By: timur-valiev
Differential Revision: D31955716
fbshipit-source-id: f799bf2b3eaae6753f41121264c777fdeda03165
Summary: T103651722 - Added a first time wizard to pick the user platforms when the user opens it for the first time. The fact that the wizard was shown is stored in localstorage.
Reviewed By: mweststrate
Differential Revision: D31861286
fbshipit-source-id: a46c532520cd88a0c4c608d3ee314289f0407475
Summary: The `'PLUGIN_DEVICE_BAIL'` event encompasses too many individual steps. This is now broken down into the various parts like closing the emulator launch dialogue, selecting multiple apps/devices or quitting the wait period.
Differential Revision: D31861520
fbshipit-source-id: ff724b461f3af8021950f4aebe87eba0b20dea79
Summary:
afcoplan found a bug in the deeplink opening flow: If a device is open but not the app that supports a supported plugin, the dialogue won't disappear once the app is connected.
That is because apps are initialised with an empty plugin list and we're doing a reference equality check to get notified of changes which won't get triggered when the deep `plugin` property is changed.
Instead, we additionally wait for the `plugin-change` event that's emitted by the client to refresh.
Differential Revision: D31861521
fbshipit-source-id: 88fc456553e218f9c8ea68435ff84bdae0d1b586
Summary: When running debug builds, and not specifying a `device=...` qualifier as part of the deeplink, you'd get stuck on the "waiting for plugin to be launched" dialogue as Flipper would accept the local MacOS (or Windows, ...) connection as a valid client which can be quite confusing.
Reviewed By: mweststrate
Differential Revision: D31857737
fbshipit-source-id: ff568544f660c51e17b40c2aaadf058588746ef9
Summary:
Open to feedback that this is making it harder to follow the code.
I was trying to make sense of some odd opening behaviour and it helped
in that case but we can also just keep this diff around to re-apply if needed.
Reviewed By: mweststrate
Differential Revision: D31857738
fbshipit-source-id: 4ebc8685e65e1cc854586518d4f790b3ad102633
Summary: Delegate sending events over IPC from the render process to the main process over the RenderHost interface. This basically removes all our direct usages of `ipcRenderer`.
Reviewed By: timur-valiev, aigoncharov
Differential Revision: D31828580
fbshipit-source-id: 9c1333ae55620d36c2af70aa7abc5403c2f4907c
Summary:
Delegate receiving events from the Electron host process to the RenderHost interface.
Typed them as well while at it.
Reviewed By: timur-valiev
Differential Revision: D31828130
fbshipit-source-id: 920055de6f48512b91a433b229dbacd611c6f139
Summary: Started abstraction some Electron specific APIs away, like process id, select directory dialogs etc.
Reviewed By: timur-valiev, aigoncharov
Differential Revision: D31827016
fbshipit-source-id: e835ac9095e63d7ea79dd0eaf7f2918ac8d09994
Summary: We used to support invoking `flipper://` to launch Flipper. This broke with the recent changes to our deeplink handling.
Reviewed By: mweststrate
Differential Revision: D31826699
fbshipit-source-id: 09d0d16de4779bb550da884d268ca9fd60f1a9e2
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
Summary:
Took a few iterations to make offline mirror happy, but everything is green now.
allow-large-files
Reviewed By: nikoant
Differential Revision: D31690614
fbshipit-source-id: 38d0d6cb5e3f63b3707d917a1ed6fc6144762731
Summary: Lots of open security warnings so I'm trying to catch a few that are behind patch releases at once.
Reviewed By: mweststrate
Differential Revision: D31574708
fbshipit-source-id: 5a4f2b18b50a3752b4986c4196a4bcda1e8a298c
Summary:
Bumps [ant-design/icons](https://github.com/ant-design/ant-design-icons) from 4.6.3 to 4.7.0.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/ant-design/ant-design-icons/commits">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/2944
Reviewed By: timur-valiev
Differential Revision: D31390474
Pulled By: jknoxville
fbshipit-source-id: d918dc9d3f7a49376784d9e93ddea7321d31c772
Summary: Reverted a change in D30192002 (9e5575cf69) that unintendendly caused some plugin containers to grow too big.
Reviewed By: nikoant
Differential Revision: D31609023
fbshipit-source-id: 56daa5efe6d9071a856536a59b473f17796201eb
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
Summary:
what else can I say
move_complexity
Reviewed By: passy
Differential Revision: D31483414
fbshipit-source-id: 1692c792121a3aae0843eb238040cae0445cdf54
Summary: Moved Logger, sleep, timeout and server contract types to flipper-common packages.
Reviewed By: passy
Differential Revision: D31475790
fbshipit-source-id: 42d2147698875f9e919ad5250f9953f3bff3ec2d
Summary: Further decoupling of `server/` from the rest of the code base. Also fixed a problem with promise chaining causing promises to create unhandled rejection errors.
Reviewed By: passy
Differential Revision: D31474919
fbshipit-source-id: 027cccbe9b57d856c94d63c093d39b6cb3e53312
Summary: In a diff down the stack I introduced sending of info/warn/error logs to Scuba. Here I'm just changing level of all connectivity-related logging to "info" as they often required for investigations.
Reviewed By: mweststrate
Differential Revision: D31532770
fbshipit-source-id: 956d6712918291579b3beb12cb91ab69ce1e3859
Summary: Just a small fix to ensure all plugins are shown in the list even if no device / app is connected to Flipper. We show them under "Unavailable plugins" with explanation why they not available. This allows user to check plugin documentation even without connecting anything to Flipper.
Reviewed By: passy
Differential Revision: D31532732
fbshipit-source-id: 4e481b3d6923bb073a1478b2bd283db25a374c72
Summary: As we now send warn logs to server - it better to reduce their count. This diff folds all the warnings for plugins using the legacy API into one warning.
Reviewed By: passy
Differential Revision: D31532559
fbshipit-source-id: 0621a170e11e9d9645964dd8ecf2f9e753273225
Summary:
This is not actionable on our end because this will get
triggered for anyone setting a wrong ANDROID_HOME path.
Reviewed By: mweststrate
Differential Revision: D31502390
fbshipit-source-id: 529f1ba940cf6e38363933f706d167196116231a
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
Summary:
This diff cleans up order remaining dialogs, the ones involved in exporting to file or url. Includes some legacy component cleanup boyscouting, but not too much.
This removes a lot of code where state of the wizard was stored globally, and makes it locally instead.
Other code that was removed involves interaction with the old UI, which allowed import / export to be running in the background as well. (which is no longer needed since we optimised the process)
Reviewed By: timur-valiev
Differential Revision: D30192000
fbshipit-source-id: 13be883c5bf217a3d58b610b78516359e9bd0ebc
Summary:
This diff moves the dialogs
* Settings
* Plugin Manager
* Doctor
* Sign in
* Changelog
To use the imperative dialog APIs, rather then organising them through reducers which adds a lot of indirection which isn't really needed but hard to follow.
Reviewed By: passy
Differential Revision: D30192002
fbshipit-source-id: ba38b2e700da3e442653786448fcbf85074981ad
Summary: This stack gets rid of Flippers old sheet abstraction that relies on native (Electron) overlays, and implements it using Ant dialogs instead. Also removes a lot of code by making dialog API imperative, rather than reducer organised, like done in the deeplink handling.
Reviewed By: passy
Differential Revision: D30192001
fbshipit-source-id: 9bca3274bd039207e58f8f9394027515e391671d
Summary: This diff separates the concept of a Client as now on the UI, from the concept of a Client as known on the server, and makes all interactions with client and vice versa async.
Reviewed By: timur-valiev
Differential Revision: D31235682
fbshipit-source-id: 99089e9b390b4c5359f97f6f2b15bf4b182b6cb9
Summary: Sets up some logging for the various drop-out points when going through the deeplink flow.
Reviewed By: lblasa
Differential Revision: D31345623
fbshipit-source-id: a06ca97c1e687e39ea97a1f47fd8bb614149056f