Commit Graph

914 Commits

Author SHA1 Message Date
Michel Weststrate
bd8912080b Kill IPC rendering / connection
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
2021-09-01 11:46:27 -07:00
Pascal Hartig
9e8ec02bf7 Remove idb describe querying
Summary: This can cause a lot of spam in the logs (locally, doesn't log as errors) and we've now found that `idb connect` is a better way to support remote devices. See https://docs.google.com/document/d/1Ih5eCyisMIzgKSJV6xichUBJMiioSJltcJCh6LCLecg/edit#bookmark=id.zhwvc6wk2bbz for more information.

Reviewed By: fabiomassimo

Differential Revision: D30546664

fbshipit-source-id: 066ea7f2eef6f82d8d6ce70db44313472b637768
2021-08-26 09:10:14 -07:00
Pascal Hartig
89d7e17c26 Fix local CSR lookup
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
2021-08-26 04:23:11 -07:00
Pascal Hartig
fa8827c103 Bump deps (#2736)
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
2021-08-25 09:02:17 -07:00
Pascal Hartig
87580c4147 Fix build (#2735)
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
2021-08-25 04:24:19 -07:00
Ananya Arun
fa7628fbf4 Auto detect devices/apps and fetch plugin details (#2734)
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
2021-08-25 00:01:05 -07:00
Pascal Hartig
1304e7c5d7 Monday patch dep bump
Summary:
allow-large-files
Only patch bumps of >1.0.0, should be safe.

Reviewed By: jknoxville

Differential Revision: D30482302

fbshipit-source-id: b5f331822ba6931b6e5f68190c7d50c62611a153
2021-08-24 17:08:25 -07:00
Pascal Hartig
fce7c7a32a Disable flaky test (#2711)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2711

See failure in T98765066. Disabling for now.

Reviewed By: nikoant

Differential Revision: D30481963

fbshipit-source-id: 555295bbab33629250b53a194de37038fea2198a
2021-08-24 08:49:45 -07:00
Pascal Hartig
30d5170dee Fix lints in CertificateProvider
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
2021-08-23 05:22:56 -07:00
Pascal Hartig
f60429cab5 Small refactors in CertificateProvider
Summary:
- Remove `fs` dependency in favour of `fs-extra`.
- Replaced `Sync` variants with async wherever possible.
- Removed some unnecessary Promise constructions.

Reviewed By: timur-valiev

Differential Revision: D30411434

fbshipit-source-id: 9faebbc1f9fb2283fec895ce3397918bc85a6c51
2021-08-20 03:52:31 -07:00
Michel Weststrate
a2644b4a2e handle device / client absence for deeplinks
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
2021-08-20 02:24:03 -07:00
Michel Weststrate
ebe5e7f9ff Make CertificateProvider side effect free in test (#2706)
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
2021-08-19 04:08:18 -07:00
Ananya Arun
648e281377 Revert D30393320 and restructure fb only and public versions (#2703)
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
2021-08-19 02:31:24 -07:00
Pascal Hartig
393e47641b Asyncify complex promise function
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
2021-08-18 15:49:00 -07:00
Pascal Hartig
75c4f20c8a Revert "First level of questions and redirection along with unit tests" (#2702)
Summary:
This reverts commit 2e87164152.

Causing OSS tests to break: https://github.com/facebook/flipper/runs/3358415851

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

Differential Revision: D30393320

Pulled By: passy

fbshipit-source-id: a326a59d35fdbe0af0c52a2502a01ab9753d2e60
2021-08-18 03:58:54 -07:00
Ananya Arun
2e87164152 First level of questions and redirection along with unit tests
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
2021-08-18 00:07:15 -07:00
Michel Weststrate
0cbe063c77 Move UnitializedClient to server
Summary: Move UnitializedClient interface to server namespace

Reviewed By: timur-valiev

Differential Revision: D30367328

fbshipit-source-id: 367a607fa2bb20dd140b1ad28946073ca764e517
2021-08-17 07:51:51 -07:00
Michel Weststrate
ea58f2b050 Decouple iOS devices from Store / core
Summary: Decouple iOS device detection from Redux

Reviewed By: timur-valiev

Differential Revision: D30309258

fbshipit-source-id: 74b4e3dd2e6b83fcefc75909794c39bfc8c987cf
2021-08-17 07:51:51 -07:00
Michel Weststrate
3736cbc480 Decouple JS device from Store
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
2021-08-17 07:51:51 -07:00
Michel Weststrate
4ae7d9c42b Decouple Metro device handling from Flipper core
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
2021-08-17 04:46:37 -07:00
Michel Weststrate
03f2f95a31 Decouple android device management from Flipper core/store
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
2021-08-17 04:46:37 -07:00
Michel Weststrate
bf65da0e72 Check if plugin status before opening
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
2021-08-17 04:44:39 -07:00
Pascal Hartig
797007f367 Make error message unique
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
2021-08-16 05:32:36 -07:00
Pascal Hartig
e880059167 Use idb describe to enumerate devices
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
2021-08-16 05:27:29 -07:00
Michel Weststrate
c0cd32564a Organise files per device
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
2021-08-13 04:02:32 -07:00
Michel Weststrate
6175424d16 separate action dispatch from server
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
2021-08-13 04:02:32 -07:00
Pascal Hartig
0de8a2eeb0 Support idb/physical devices for screen record
Summary: Another thing that's now supported by idb.

Reviewed By: mweststrate

Differential Revision: D30283450

fbshipit-source-id: fd973571c551b0823ba9c539c795d4dd526415b1
2021-08-13 03:29:30 -07:00
Pascal Hartig
87e5e18c46 Support idb/physical devices for navigation
Summary: idb has a command for doing the same now.

Reviewed By: timur-valiev

Differential Revision: D30277192

fbshipit-source-id: eb46cdc7a7218077a7da90f6182d5f17bfcc758a
2021-08-12 07:59:45 -07:00
Michel Weststrate
dd47d08444 move device dispatchers to server
Summary: move_complexity

Reviewed By: passy, timur-valiev

Differential Revision: D30250314

fbshipit-source-id: 92510b0ed2555d039b75b6de1c14fc92d94fbb19
2021-08-12 05:43:44 -07:00
Michel Weststrate
5e8c968222 Move devices to server folder
Summary:
This is the first of many diffs that extracts the connection, device, client detection out of the flipper core, to create a reusable flipper-server library that can be used in e.g. flipper-dump.

To keep diffs a little smaller, the current connection logic is first moved to the `server/` directory, and decoupled manually from the rest of the core, before moving it over to a separate package.

This first diffs moves the `comms/`, `devices/` and certificate utilities to the `server` directory.

Further untangling will follow in next diffs

Reviewed By: timur-valiev

Differential Revision: D30246551

fbshipit-source-id: c84259bfb1239119b3267a51b015e30c3c080866
2021-08-12 05:43:43 -07:00
Pascal Hartig
6544e5a7a3 Fix large debugbutton numbers being cut off
Summary: One more.

Reviewed By: timur-valiev

Differential Revision: D30254356

fbshipit-source-id: 473532b1aeef00d95d1da0ca8f1ca047672bc432
2021-08-12 03:19:38 -07:00
Pascal Hartig
4d295fa261 Prevent NUX from being cut off in plugin bar
Summary: See test plan.

Reviewed By: timur-valiev

Differential Revision: D30253538

fbshipit-source-id: c98a9b3ddaa29d6ff11260ce5756fd85f120e749
2021-08-12 03:19:38 -07:00
Pascal Hartig
eb27796571 Fix Windows test (#2682)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2682

Run path-specific tests only on Unix-like OSes. We could
easily change the path to Windows, but honestly it's enough
to confirm this on one platform.

Reviewed By: timur-valiev

Differential Revision: D30255014

fbshipit-source-id: 7db36bc1738d721625e3c86c210d46dfaf8f0ab8
2021-08-11 14:35:12 -07:00
Pascal Hartig
7df77e2620 Asyncify screenshot helper
Summary: Suggested by mweststrate. Much more readable now!

Reviewed By: mweststrate

Differential Revision: D30251322

fbshipit-source-id: 269fefce3f63fa4eababb4c541ff09a660cc5cc0
2021-08-11 11:03:45 -07:00
Pascal Hartig
757ba91bf6 Simplify bridge types
Summary: This turns the bridge type into a simpler struct with always-present methods so you don't need to add additional null check to the calling logic which are hard to deal with.

Reviewed By: mweststrate

Differential Revision: D30248628

fbshipit-source-id: cdaee44efcbb19dcbb301099b4a7d0eb0c350e67
2021-08-11 11:03:45 -07:00
Pascal Hartig
52b3edc5ad Move screenshot to iOSBridge
Summary:
In order to support IOS cloud devices, we need to abstract
over the direct uses of idb/xcrun so we can switch them
out based on more than the device type.

Note that there's a bit of a type weirdness in there. I'll
clean this up with the next diff.

Reviewed By: mweststrate

Differential Revision: D30248036

fbshipit-source-id: ec8571429e04abe059850ef334a6645ae4a5e034
2021-08-11 11:03:45 -07:00
Pascal Hartig
f515df1c01 Restructure iOS dispatcher initialization
Summary:
Avoid nested promises and log errors during initialization that were
previously thrown away.

Reviewed By: mweststrate

Differential Revision: D30247859

fbshipit-source-id: 1d9ef871d1861a25a64ed4e895978b04f5b51c7b
2021-08-11 11:03:45 -07:00
Pascal Hartig
a630020ea0 Remove promisify use
Summary:
The results are often unpredictable, poorly typed and we have
dependencies that do the wrapping for us.

Listen, I'll get to writing some real code soon, I promise,
but I need to clean up my workspace first, okay?

Reviewed By: mweststrate

Differential Revision: D30247484

fbshipit-source-id: f5326ff71ff43af2dc64ab85ca1368f95fe87083
2021-08-11 11:03:45 -07:00
Pascal Hartig
4e17fb9c48 Extract temp path util
Summary:
`electron.remote` access is slow so we can cache this
like we do in other places. Also means one fewer `electron`
import which is gonna add up for Flipper Decap.

Reviewed By: mweststrate

Differential Revision: D30247431

fbshipit-source-id: 90f0e8df99af8bed40fbebcfd445abaca2965b7c
2021-08-11 11:03:45 -07:00
Pascal Hartig
11c1c39bdc Improve screen recording logging
Summary:
Error is handled, doesn't need a task. Also, prefix is wrong here
as it's used.

Reviewed By: mweststrate

Differential Revision: D30247416

fbshipit-source-id: 049490cb7e45b7ce6f433bf7366eb94893947625
2021-08-11 11:03:45 -07:00
Pascal Hartig
8223051905 Mute eslint rule
Summary:
A few drive-by changes ahead of the sustainathon.
(More to come.)

Reviewed By: mweststrate

Differential Revision: D30247395

fbshipit-source-id: e707377a1169eb634a42f08c3d27fe3e065b63bb
2021-08-11 11:03:45 -07:00
Pascal Hartig
dd536b9d1a Gracefully handle socket closures
Summary:
Got my first auto-created crashbot task. {emoji:1f973}

We do have some pretty granular handling for errors during disconnects but this one has fallen through the cracks.

I'm not 100% sure if this is the right way to handle it which is why I added mweststrate. :)

Reviewed By: mweststrate

Differential Revision: D30218833

fbshipit-source-id: 2b4c9201ee7faf1c278b1cc5268ad2648dc4c820
2021-08-10 16:12:02 -07:00
Michel Weststrate
8d7caa9dd4 Introduce Dialog.alert
Summary: Introduce `Dialog.alert` to show users a FYI message, and be able to wait for it to be handled, as utility around several `Modal` utilities.

Reviewed By: jknoxville

Differential Revision: D29875484

fbshipit-source-id: 5d2ea83e486631ac18a81800b467f97dfaac6d34
2021-08-10 13:24:23 -07:00
Michel Weststrate
4b892e7373 Check Flipper version when handling deeplinks
Summary: Check if Flipper is up to date before handling deeplink.

Reviewed By: nikoant

Differential Revision: D29846236

fbshipit-source-id: 011d05958346c3d18c76cf0ae63c3cb087f5933c
2021-08-10 13:24:23 -07:00
Michel Weststrate
38473121ba Check connection & user login when entering deeplink [1/n]
Summary: First steps in smoother deeplink flow, where connection and login status is being checked before trying to handle the deeplink.

Reviewed By: lblasa

Differential Revision: D29790461

fbshipit-source-id: e1e42ceb5db59c695077f316e836f1f216c7204a
2021-08-10 13:24:23 -07:00
Pascal Hartig
47faeade61 Patch dep bump
Summary: Excluding `react-virtual` which seems to include a breaking change with the patch release.

Reviewed By: jknoxville

Differential Revision: D30189687

fbshipit-source-id: b40cb5edd407fd03009ee38c0af5202c8deaaa26
2021-08-10 11:08:22 -07:00
Anton Nikolaev
cc4064ec9f Force Sec-Fetch-Site header to 'none'
Reviewed By: bartoszniemczura

Differential Revision: D30047497

fbshipit-source-id: 0d9376c09d63176031291f19bfe82a56d5677641
2021-08-05 02:40:41 -07:00
Ananya Arun
a5b83dc148 Add tracking for usage statistics
Summary:
- This diff adds usage statistics for
    - How often was the troubleshooting button opened
    - What were its end states ( Problem solved or file a support request)

- I am using the tracked flipper plugin to obtain and analyse the stats on Infinity analytics events dev in Scuba backend.
(Since this is not yet productionized we are using the dev version now )

Reviewed By: nikoant

Differential Revision: D30098054

fbshipit-source-id: 871cc18872bccf70a829dc1dd173a337b02ec6e6
2021-08-04 04:16:52 -07:00
Ananya Arun
84ec5813b6 Add modal dialogue for the end screen
Summary:
- Added a dialogue with 2 possible end state buttons
    - Problem Solved
    - File Support Request
- This diff is the start of the implementation of the troubleshooting wizard.
- The previously implemented troubleshooting button (D29993355 (921a65bc17)) now links to a modal dialogue box.
- This is essentially the last screen of the troubleshooting guide to be implemented.
- We have options for a user to either select file a support request if the issue persists after navigating the guide or click on problem solved if the guide helped them solve it.
- Selecting option 2 (file support request) links to the pre-existing form

The modal has been implemented as an independent reusable component and can be easily extended.

Reviewed By: passy

Differential Revision: D30069270

fbshipit-source-id: f61bf8c03de786e11b7f06194328dbee703abf8b
2021-08-03 12:49:49 -07:00
Lorenzo Blasa
4e6b895fc9 WebSocket server GK
Summary:
This change enables a WebSocket server if the user is on the 'flipper_websocket_server' GK.

I don't expect this change to make it as the final product of the entire solution. Instead, it can be used to quickly enable/disable WebSocket during development/testing without requiring any code changes.

Reviewed By: passy

Differential Revision: D30069694

fbshipit-source-id: 75daac75e6dad7f63cf194d8287971c33d3abb61
2021-08-03 09:34:57 -07:00