Summary:
Currently, when a new app connects to Flipper, we show a lost connection notification even though it successfully connects to Flipper.
It happens because we of the device_id mismatch.
Reviewed By: mweststrate
Differential Revision: D32169917
fbshipit-source-id: 6df3ae7fd621b4549e18c1835473a13f18cfb339
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: - We are using the `Sidebar` component in our `LogViewer` implementation and we noticed that it needed some styling updates to be used properly as a vertical `Sidebar`.
Reviewed By: mweststrate
Differential Revision: D32083159
fbshipit-source-id: 441f3972ae900b5d5f353d3c7b56117c489850ba
Summary:
Workaround for idb weirdness
Originally started at D27590885
Re-appared at https://github.com/facebook/flipper/issues/3009
Reviewed By: mweststrate
Differential Revision: D32106952
fbshipit-source-id: 63d4fa64503c5c2ba80dae113850c937450ab0fb
Summary:
idb sometimes returns duplicates when we query targets. It leads us to removing valid devices and reconnecting to them again. Eventually, it starves the idb thread pool.
This diff removes the duplicates from the idb output.
Reviewed By: jknoxville
Differential Revision: D32099320
fbshipit-source-id: 7d8b756360f82557000ea5aa037a249b33be9961
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: Setting the lint level to error and fixing the last three violations.
Reviewed By: nikoant
Differential Revision: D32109025
fbshipit-source-id: 213ecaa17317f665ac5a192682fa06d182c28581
Summary:
This was the last eslint warning for `flipper-server-core` and the only call-site
was async already.
Reviewed By: mweststrate
Differential Revision: D32026626
fbshipit-source-id: 0d6f06086c33707b26f58f668ad533daca9de7dd
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: Achieving API parity with C++ and Android.
Reviewed By: lblasa
Differential Revision: D31921830
fbshipit-source-id: 873901107fc3c53166fa7bbaaff65ebdb0e53c2a
Summary: Current implementation uses type `string` as a key for indexing items stored in datasource. However, users can provide any key as an index which means that the type of index item can be anything, not only string. This diff introduces a more refined types for the key. It adds another requirement to provide a key property to a generic which is used to infer the index type.
Reviewed By: mweststrate, aigoncharov
Differential Revision: D31895751
fbshipit-source-id: 19ba907bd6f35df87e3fa442db5fc5cec6af174d
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:
Bumps [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise) from 5.1.0 to 5.1.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/xjamundx/eslint-plugin-promise/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/3001
Reviewed By: passy
Differential Revision: D31991583
Pulled By: cekkaewnumchai
fbshipit-source-id: af1be4f0e2d70885d2d6622363a7433a786c7778
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:
I relied too much on the types which in this case don't help at all.
Filtering on a promise will just automatically get all values to pass.
Pull Request resolved: https://github.com/facebook/flipper/pull/3008
Test Plan: `yarn build --mac` works again on the GH checkout.
Reviewed By: mweststrate
Differential Revision: D31991576
Pulled By: passy
fbshipit-source-id: f632d29ddfc09b7130b68b4b17264fd30e1969ce
Summary: Mostly ignoring things in this one because it's tests.
Reviewed By: timur-valiev
Differential Revision: D31955716
fbshipit-source-id: f799bf2b3eaae6753f41121264c777fdeda03165
Summary: Was gonna write some docs so wanted to use the opportunity to get docusaurus up-to-date.
Reviewed By: jknoxville
Differential Revision: D31956185
fbshipit-source-id: be7304ac2def5bb5576e076c1c13f79cb2b4bab3
Summary:
[Reported in the support request](https://fb.workplace.com/groups/flippersupport/posts/1237466586733997/), Activity object is held by ObjectTracker even though the Activity is destroyed. This, in this case, caused strict mode in Portal app to forcibly terminate.
This diff tried to remove activities from the reference holder.
Reviewed By: passy
Differential Revision: D31828290
fbshipit-source-id: aad7e8d7ba14069f8dd7c654a3604d482d85e110
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:
- We're using the `Tabs` component from `flipper-plugin` and upon adding them, we noticed that our view being displayed within the tabs no longer scrolled and the tab internally was being stretched far off the screen. (D31538124)
- After egp did some digging, he discovered that by adding the `maxWidth` style property to the inner `Layout.Container`, the tab no longer stretched and the scrolling was restored.
- We played around by adding wrapper elements around the contents of our Tab and adding the same style prop, but this did not yield the same result.
***Would Love some input from the Flipper team as to the best way to ensure that this won't break other's plugins. Thank you!***
Reviewed By: mweststrate
Differential Revision: D31672790
fbshipit-source-id: 99cab1873f359f4c1827e4c94f2527636884c237
Summary:
This change adds 'adb' to the error message checks. If the device is Android, is confusing to suggest the problem may be with 'idb'.
This could be further improved by looking at the client OS and device type to suggest formulate the correct message.
Reviewed By: passy
Differential Revision: D31894695
fbshipit-source-id: 8eb2ca152807afd9706af1523c917803611246d7
Summary:
1. Update js-flipper's version in pre-release
2. Update current version of js-flipper to match react-native-flipper
3. Publish js-flipper automatically
Reviewed By: mweststrate
Differential Revision: D31858522
fbshipit-source-id: e5a9816980d89d3ca6745bc16942f7b75f8d2a88
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