Summary: Per title, processed some pending review comments made earlier in this stack
Reviewed By: aigoncharov
Differential Revision: D32916920
fbshipit-source-id: 01db85883596b5c85b77efc9cddadeac23cc4ef5
Summary: This diff makes sure that when the client starts, it fetches all known devices and clients first, as it might have missed the 'connect' events for those. For Electron this wasn't needed, since the server starts with the UI, but this makes sure that a browser reload or a second connection sees the same devices & apps
Reviewed By: aigoncharov
Differential Revision: D32881589
fbshipit-source-id: 7b1cb3d296044f83dedcf3f3d8d02864690b6666
Summary: This diff moves send intern request from the browser to the server. The reason to make this change is that making such requests from a browser environment causes CORS restrictions to kick in.
Reviewed By: nikoant
Differential Revision: D32835449
fbshipit-source-id: e8e92e51ca963aa50b3c859bb61c2381171e85ae
Summary: This diff stubs all node modules when running in the browser, so that, albeit with a lot of errors and without plugins, the UI loads in a browser. To be continued in the rest of this diff
Reviewed By: antonk52
Differential Revision: D32665705
fbshipit-source-id: 4632e241f59c5b9712a41d01a26878afb01f69b5
Summary: Added a command to let a file be opened by the OS, and some other small bits and pieces to make Flipper browser compatible.
Reviewed By: lblasa
Differential Revision: D32721748
fbshipit-source-id: a4ad1c2f662f4651ddf6c20c57e5af1e123914a8
Summary: Per title. Two new server API's: get-healthchecks, and run-healtcheck. Types have all been moved to flipper-common, so that they can be used by doctor, server-core and ui-core packages. Since it were quite some, moved them into a FlipperDoctor namespace.
Reviewed By: nikoant
Differential Revision: D32720510
fbshipit-source-id: 37aa35cde6ebd58479cf0dffec5b7b2da6d22198
Summary: This diff makes most stuff that is read from the `os` package, and version info etc available from the `serverConfig` object, so that flipper-ui-core no longer needs the `os` package.
Reviewed By: passy
Differential Revision: D32694848
fbshipit-source-id: 93af1e95d898da9aaf351a6970b5a7652ee835c8
Summary: This diff makes plugin loading async, which we'd need in a browser env (either because we'd use `import()` or we need to fetch the source and than eval it), and deals with all the fallout of that
Reviewed By: timur-valiev
Differential Revision: D32669995
fbshipit-source-id: 73babf38a6757c451b8200c3b320409f127b8b5b
Summary:
Follow up of D32665064, this diff moves all plugin management logic from flipper-ui to flipper-server. Things like downloading, installing, querying new plugins.
Loading plugins is handled separately in the next diff.
Reviewed By: nikoant
Differential Revision: D32666537
fbshipit-source-id: 9786b82987f00180bb26200e38735b334dc4d5c3
Summary: Moved all types related to plugin descriptions from plugin-lib (which handles downloads and such) to flipper-common. The goal of that is to remove all plugin-lib usage from ui-core to server-core, so that the UI itself doesn't do any file operations anymore related to plugins. That will be done in next diffs, this just moves types but no code.
Reviewed By: nikoant, aigoncharov
Differential Revision: D32665064
fbshipit-source-id: 86d908e7264569b0229b09290a891171876c8e00
Summary:
Notice during debugging that devices keep unregistering. Doesn't lead to any practical issues, but still incorrect.
Also noticed that the server didn't restart when changing flipper-server-core, or recompile its deps, so fixed that as well.
Reviewed By: passy
Differential Revision: D32644276
fbshipit-source-id: 5384a30c9d293acda04b6e6f940268ddcd65a870
Summary:
This diff sets up the socket connection between flipper-browser and flipper-server, and verifies that the initial UI initialisation work (e.g. `get-config` command works). The initial RenderHost is initialised as well based on the config and browser APIs.
Note that flipper-ui-core itself isn't started yet, as that has still a plethora of node imports, so Metro will correctly refuse to bundle
Not in this diff
* remove Node usage from flipper-ui-core
* implement all RenderHost APIs
Reviewed By: aigoncharov
Differential Revision: D32644074
fbshipit-source-id: 2c8065caf0191771a3867b69a431ca50eeb7a5a3
Summary: This diff moves keychain storage to the server. Figured to leave request logic itself in the UI-core, as basically all use cases happen there, except for streaming download for mobile build plugin, so sending the requests from the backend doesn't really seem to add value, unless we run into some CORS issues later.
Reviewed By: passy
Differential Revision: D32596715
fbshipit-source-id: f5ab9d794f91a6eb8a8dc07ae723bf2890726771
Summary:
This diff moves a lot of stuff from the client to the server. This diff is fairly large, as a lot of concept closely relate, although some things have split off to the earlier diffs in the stack, or are still to follow (like making intern requests).
This diff primarily moves reading and storing settings and GKs from client to server (both flipper and launcher settings). This means that settings are no longer persisted by Redux (which only exists on client). Most other changes are fallout from that. For now settings are just one big object, although we might need to separate settings that are only make sense in an Electron context. For example launcher settings.
Reviewed By: passy, aigoncharov
Differential Revision: D32498649
fbshipit-source-id: d842faf7a7f03774b621c7656e53a9127afc6192
Summary: This diff makes sure flipper-ui-core no longer depends on flipper-server-core. Currently server config is still transferred from UI to server, which doesn't really make sense in future scenarios where server might start before client, but will address that separately
Reviewed By: timur-valiev, aigoncharov
Differential Revision: D32462835
fbshipit-source-id: 498a944256ba1aabbf963b896953e64d11e27214
Summary:
{F684271717}
^
This is causing the error being reported quite a lot. The identifier doesn't provide much information to the person analysing the error. Only ever useful if debugging.
Reviewed By: antonk52, mweststrate
Differential Revision: D32828150
fbshipit-source-id: f29fbf6bfe389fec6ef888fc01be6c058193709d
Summary: The errors files for this aren't actionable and cannot be deduplicated because of the information included. Better to treat this as a warning.
Reviewed By: nikoant
Differential Revision: D32758656
fbshipit-source-id: 5255d694b8783b7bb49f981933741063d012df98
Summary: We can't action tasks based on this report, so better to raise it as a warning.
Reviewed By: nikoant
Differential Revision: D32758850
fbshipit-source-id: 2e8ff984f40d2d0431db192e8f2d983d52b77ccd
Summary: By tracking when clients connect and disconnect, we will be able to answer how long does it take for clients to connect
Reviewed By: passy
Differential Revision: D32697702
fbshipit-source-id: b01893f500c97b08eb4434733058f58433d7f4ef
Summary:
…s directory
Currently, flipper tries to launch emulators using `<android sdk path>\tools\emulator.exe`. The use of this emulator path has been deprecated for a while now, and remains in the sdk for those on versions of Android Studio 2.2 and older (see https://issuetracker.google.com/issues/66886035?pli=1). The supported path is `<android sdk path>\emulator\emulator.exe`. Trying to use the deprecated path on Windows results in a failure to launch AVDs.
## Changelog
Point emulator path to emulator directory instead of deprecated tools directory.
Pull Request resolved: https://github.com/facebook/flipper/pull/3046
Test Plan: Verified a failure to launch the AVD on windows using the deprecated path. Confirmed that updating the path results in a successful launch and the device showing up in flipper.
Reviewed By: passy
Differential Revision: D32489840
Pulled By: nikoant
fbshipit-source-id: dde5bf5a29e89549f160d9d71133ff70398e1c1d
Summary:
…tems
When trying to start an android emulator in Windows, there is a failure in trying to read `<avd name>.ini`. The reason for this is because when we run `<android sdk path>\tools\emulator.exe -list-avds`, a split is performed with the new line character (`\n`). Unfortunately, this does not work for Windows, which uses `\r\n` as the new line termination. This results in a carriage return remaining on each output string, which results in trying to access `<avd name> .ini`, which is an invalid path.
The fix is to update the split to use a regex that is compatible for both Unix and Windows based systems.
## Changelog
Updating splitting of avd names to work on Windows and Unix based systems
Pull Request resolved: https://github.com/facebook/flipper/pull/3041
Test Plan: Verified the avd names didn't have any trailing whitespace, and the emulator is able to launch.
Reviewed By: mweststrate
Differential Revision: D32387162
Pulled By: nikoant
fbshipit-source-id: 0900bee17b225cfa5484a29c96f8e2c1c2e31477
Summary:
This change removes the usage of a GK to open WebSocket ports.
The WebSocket ports have been open for quite a while to all members of the Flipper Support Group. OSS users will now open the ports as well.
Reviewed By: mweststrate
Differential Revision: D32244706
fbshipit-source-id: e441dfd43c51dda26f259ae7d7ebc3d721cc1c99
Summary:
Changelog: Fix server certificates not being generated for first time users.
As reported in https://fb.workplace.com/groups/flippersupport/permalink/1247554795725176/, server certificates are not generated properly for new users.
Also the fix. Omg. How does typechecking not find this?
...Oh yeah yeah I now, `await not-a-promise` is juuuusst fine. Long live `.then(` I guess...
Reviewed By: jknoxville
Differential Revision: D32203132
fbshipit-source-id: abd75c178e9c8640a266b2012b9250503d4258be
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:
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 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:
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: Create an example of how one can use `js-flipper` in a browser to connect to Flipper over WS.
Reviewed By: mweststrate
Differential Revision: D31688114
fbshipit-source-id: 135f826daeddeda8dca5b3df6504cc2bdc04dd1b
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: Port forwarding tool was logging the child process object. Made the logging cleaner and more useful.
Reviewed By: nikoant
Differential Revision: D31608867
fbshipit-source-id: 1c2ae7c926ed4e1b44d51db5415874600acde7ae
Summary: This change adds the alt ports to the list of ports to be reversed on Android
Reviewed By: mweststrate
Differential Revision: D31607559
fbshipit-source-id: 4e1201c7255fcd3a437c743f827ae4bceb746348
Summary: I unintentionally added logging of csr certificates in my previous diff. This diff makes sure we're not logging them anymore.
Reviewed By: mweststrate
Differential Revision: D31609709
fbshipit-source-id: e43b348dbd62653f8a6e9089930c2a3699b29a12
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:
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