Commit Graph

159 Commits

Author SHA1 Message Date
Andrey Goncharov
f8e4c0c02c Log invalid URL
Reviewed By: passy

Differential Revision: D35050026

fbshipit-source-id: 95d367a752351a728d355edd56cb68156c80c8b5
2022-03-23 07:37:10 -07:00
Andres Orozco Gonzalez
83133618d6 add adbkit configurations settings
Summary: Adbkit configurations settings may be neccesary when we want to run flipper-server in an IPv6 stack machine as localhost would bind to [::1] rather than 127.0.0.1 which is where the adb server usually runs

Reviewed By: mweststrate

Differential Revision: D34964851

fbshipit-source-id: 9cf70f9bdc0c40e92382b1537013439f85983f65
2022-03-23 04:24:23 -07:00
Pascal Hartig
c180b24753 Fix typo
Summary: Well, and added another word.

Reviewed By: lblasa

Differential Revision: D34944504

fbshipit-source-id: eb4e7db05ee846721fa18899aa50596124632b5b
2022-03-17 04:11:37 -07:00
Lorenzo Blasa
76847bbef1 Do not emit errors when unable to extract client query
Summary:
^

Usually, when launching Chrome, this error will take place a significat amount of times. By looking at the HTTP request, it is difficult to determine the origin other than being a Chrome extension.

There's no actionable items in Flipper, so do not emit the error.

Changelog: Do not emit errors when unable to extract client query

Reviewed By: antonk52

Differential Revision: D34898603

fbshipit-source-id: fbeb2db7ec2914669192cbebc2e6b15464e31827
2022-03-16 02:26:42 -07:00
Lawrence Lomax
995d1c8180 Remove IOSDevice.buffer, IOSDevice.log
Summary: It's unused, can only assume that it was a log buffer in some distant time which is now hidden behind a separate log listener class

Reviewed By: passy

Differential Revision: D34787086

fbshipit-source-id: 0f920649c119efc5172ca7dcc6b53cfb802a5cbf
2022-03-10 09:48:42 -08:00
Pascal Hartig
71bdb23a1d Make log clear failures a warning
Summary:
Logcat can sometimes fail to clear the logs for some reason.
There's nothing we can do about this as we're directly calling out to adb.

Reviewed By: lawrencelomax

Differential Revision: D34749970

fbshipit-source-id: 2166717ace491f7b73b380576392638ef9276b78
2022-03-09 07:40:39 -08:00
Pascal Hartig
9bd6c7f54a Remove unused import
Summary: Per title.

Reviewed By: jknoxville

Differential Revision: D34749935

fbshipit-source-id: 8adaedf18d1528a60a0623bbe67b8072e3d11b13
2022-03-09 07:40:39 -08:00
Pascal Hartig
6d05e6c226 Bump /desktop again
Summary:
New round of releases and PRs came up, so bumping again.

Very selective Metro update as some dependencies don't play well together. A bunch of other dependencies use ESM and fail at various stages of the build or runtime process.

Reviewed By: mweststrate

Differential Revision: D34688830

fbshipit-source-id: 2ff5c46c253b814140f634a986ba0d246e9b0945
2022-03-08 03:02:11 -08:00
Pascal Hartig
a5529d789d Don't raise EADDRINUSE as error on startup
Summary:
There will likely be more so I added a place for inspecting
these messages to the top.

Reviewed By: antonk52

Differential Revision: D34681084

fbshipit-source-id: ad32145d44dba08b813d8a2ddc63d500a0c360d8
2022-03-07 09:09:52 -08:00
Anton Nikolaev
37ff34390a Enable Marketplace for Flipper (#3491)
Summary:
This is PR on top of: https://github.com/facebook/flipper/pull/3473

It adds an option to Settings to allow distribution of marketplace plugins.

Also includes a simple fetch function to retrieve data from external API/server.

## Changelog

Allow marketplace plugins

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

Test Plan:
1. Enable marketplace
2. Provide custom marketplace server (it will serve the list of internal plugins with downloadURL)
3. Test if can see Available plugins and can download/remove the plugin
4. If new update for the plugin, it should also allow auto update

Reviewed By: antonk52

Differential Revision: D34586339

Pulled By: nikoant

fbshipit-source-id: c887982aa0f0f9abd3b5360f22e8692a2445d345
2022-03-07 02:49:49 -08:00
Andrey Goncharov
6c74f2dd18 Set device features on device initialization
Summary:
1. Identify if device supports screenshots/screen recording when it is created.
2. Disable screen recording/screenshot buttons when they are not supported

Reviewed By: passy

Differential Revision: D34611133

fbshipit-source-id: 82ad2d67e4af482d9becf7995187667b5d99bc36
2022-03-04 02:00:23 -08:00
Pascal Hartig
7c1251075f Dep bump for /desktop
Summary:
Combining a bunch of dependabot PRs.

N.B. I had to manually clean up the `yarn.lock` a few times because some dependencies resolved to multiple version numbers, catching tsc off-guard.
allow-large-files

Reviewed By: nikoant

Differential Revision: D34579180

fbshipit-source-id: a4848e1010ff240d9b0e721d3878585e7b4bd078
2022-03-03 04:11:52 -08:00
Andrey Goncharov
5068c8273b Add deprecation notice notification
Summary: Add deprecation notice device icon and notification

Reviewed By: lblasa

Differential Revision: D34582475

fbshipit-source-id: 90fde15caf1925b42f50fbfc77dece88c82833cf
2022-03-02 09:18:15 -08:00
Andrey Goncharov
3ec5b56263 Polyfill fetch
Summary: Provide server add-on writers with a well-known fetch API

Reviewed By: mweststrate

Differential Revision: D34447630

fbshipit-source-id: 70386940c12f9e53aa97b3530a7edf1d40b5f2e2
2022-02-28 03:50:34 -08:00
Andrey Goncharov
aec05533d7 Expose a subset of flipper-plugin to flipper server
Summary: Flipper plugins rely on 'flipper-plugin' package being accessible from 'global'. Expose a subset (without UI stuff) of flipper-plugin to server add-ons

Reviewed By: mweststrate

Differential Revision: D34400811

fbshipit-source-id: e0079ddfa67e66c1b24ab02d7682917ddfc84aaf
2022-02-28 03:50:34 -08:00
Andrey Goncharov
01a5f3da90 Add generics to server add-on connection
Reviewed By: mweststrate

Differential Revision: D34307356

fbshipit-source-id: 27e61355a85995368ebb197c42d58f4145473567
2022-02-28 03:50:34 -08:00
Andrey Goncharov
9e4ac0aaa9 Add unit tests for PluginManager
Reviewed By: mweststrate

Differential Revision: D34307076

fbshipit-source-id: 7cb6c808bea10d15627958e8fabc02b4563183d4
2022-02-28 03:50:34 -08:00
Andrey Goncharov
d96cf8127f Add unit tests for ServerAddOn
Reviewed By: mweststrate

Differential Revision: D34303780

fbshipit-source-id: 03a4570a6e891d979b87caca14f51068d74df877
2022-02-28 03:50:34 -08:00
Andrey Goncharov
81d0057a8d Fix potential race conditions for starting/stopping server add-ons
Reviewed By: mweststrate

Differential Revision: D34301593

fbshipit-source-id: 2950de8a8567318cd3e87eff176657df5ba8fd1b
2022-02-28 03:50:34 -08:00
Andrey Goncharov
8b94186783 Load installed server add-ons
Reviewed By: nikoant

Differential Revision: D34300475

fbshipit-source-id: 6bb6c0ab811e28806a0924b3487931bdb0dd2c59
2022-02-28 03:50:34 -08:00
Andrey Goncharov
4067f5bd88 Implement sending messages from desktop to add-on
Reviewed By: antonk52

Differential Revision: D34239803

fbshipit-source-id: 1a18d522ba877ade3d0703fbb374c15b596241d7
2022-02-28 03:50:34 -08:00
Andrey Goncharov
2ce037d96b Load bundled server add-ons
Reviewed By: antonk52

Differential Revision: D34238883

fbshipit-source-id: 01b4b1c1c0a63cbfb639e903f6a77307ae370330
2022-02-28 03:50:34 -08:00
Andrey Goncharov
b655efc78e Migrate to default exports for server add-ons
Reviewed By: antonk52

Differential Revision: D34201906

fbshipit-source-id: 3ee2bf831d5a1f5c6c9252acce1b1731462871f1
2022-02-28 03:50:34 -08:00
Andrey Goncharov
04eab80c98 Move server add-on interfaces to flipper-common
Reviewed By: antonk52

Differential Revision: D34169419

fbshipit-source-id: 69fcc8da7d98f59818fbb5b486a488f19830cd81
2022-02-28 03:50:34 -08:00
Andrey Goncharov
b9294645d3 Limit methods server add on can access
Reviewed By: mweststrate

Differential Revision: D34076174

fbshipit-source-id: e51a1b08dab54de6b7dc82ca59ec18a10f81ddd7
2022-02-28 03:50:34 -08:00
Andrey Goncharov
db976d5113 Implement sending messages from a server add-on
Reviewed By: mweststrate

Differential Revision: D34074383

fbshipit-source-id: de85e7a22dc9bb780163fc5b522708e8bc976df3
2022-02-28 03:50:34 -08:00
Andrey Goncharov
842b2c810a Implement sending messages to server add-on
Reviewed By: mweststrate

Differential Revision: D34073403

fbshipit-source-id: eacd73811b436f2b5c4255a83d8eb09367a96a67
2022-02-28 03:50:34 -08:00
Andrey Goncharov
12151e4a71 Extend Flipper commands to support server add-on messaging
Reviewed By: mweststrate

Differential Revision: D34046466

fbshipit-source-id: 9acc172c1805ec724b8709999bacf9e899c39e6b
2022-02-28 03:50:34 -08:00
Andrey Goncharov
3b390b74ff Track client connections and autostop server add-ons when all clients leave
Reviewed By: mweststrate

Differential Revision: D34045584

fbshipit-source-id: 1ad0cfffb9d304f0359c973d76d6956f7e932f72
2022-02-28 03:50:34 -08:00
Andrey Goncharov
a60865f0be Intergrate ServerAddOn with PluginManager
Reviewed By: lblasa

Differential Revision: D34042338

fbshipit-source-id: 2ae3992738e647075f19c4dba0ebfb01e6c12b8f
2022-02-28 03:50:34 -08:00
Andrey Goncharov
016299b374 Add server-side ServerAddOn entity
Reviewed By: lblasa

Differential Revision: D33982373

fbshipit-source-id: a07589e515fe82d3735402cc26d1258e1d212931
2022-02-28 03:50:34 -08:00
Andrey Goncharov
fc20abf392 Add Flipper server command definitions
Reviewed By: lblasa

Differential Revision: D33980529

fbshipit-source-id: b64f48134d4816d3502c70d15beff90a044490a4
2022-02-28 03:50:34 -08:00
Lorenzo Blasa
395708348d Remove RSocket documentation references
Summary:
^
Changelog: Remove RSocket documentation references

Reviewed By: jknoxville

Differential Revision: D34345316

fbshipit-source-id: 5b9fac8c04e325f3f02ef3713b0146b17e694c9d
2022-02-21 06:22:44 -08:00
Lorenzo Blasa
c45164ec2b Log unable to extract clientQuery as warning instead of error
Summary:
^
LogView is raising this up but I don't think there's an actionable item from our side. If a client doesn't have the right arguments on the query string then we effectively are unable to construct a valid query.

All our clients do this correctly, but there may be instances that either a browser or another process is 'trying' to connect to Flipper even if unintentionally. This behaviour I've observed in the past.

Changelog: Log 'Unable to extract the client query from the request URL' as warning

Reviewed By: passy

Differential Revision: D34340068

fbshipit-source-id: f5fc36a9803a83d6662b6383589bc0aa99774798
2022-02-18 05:50:07 -08:00
Pascal Hartig
3945675ca0 Remove dynamic data from error
Summary:
Dynamic information means we can't deduplicate on the backend.
Logging the serial as a warning instead.

In general, I'm not convinced this is a good error to begin with
as it seems expected that devices can disappear on disconnect
but getting a better count should help to make that decision.

Reviewed By: aigoncharov

Differential Revision: D34247723

fbshipit-source-id: ace3c32d2370433dcca2debbea3a2c5d7a2ecb57
2022-02-16 07:59:45 -08:00
Andres Orozco Gonzalez
b2dae4da81 Add support to load settings from options (flag) and default to specific options
Summary: This change gives priority to a user option settingsString to set up the flipper-server configuration and load them from a json string. Also giving the user the chance to avoid flipper-server looking at the launcher config files in the computer

Reviewed By: mweststrate

Differential Revision: D34210110

fbshipit-source-id: 9e852b79da106b5140c59116fd7d0c0f3155e620
2022-02-16 06:23:45 -08:00
Peter Velkov
9d2f11f505 Fix adb path check on Windows (#3434)
Summary:
The adb path check seem to be platform dependent

Instead of pre-validating the path we can execute the intended command and retry with an alternative adb path only if it fails with file not found error

Related to https://github.com/facebook/flipper/issues/3430 (adb is not detected)

## Changelog

Fix ADB detection and startup on Windows

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

Test Plan:
#### adb is detected successfully when `adb.exe` is in `platform-tools`
![image](https://user-images.githubusercontent.com/12156624/153605414-b85c1aef-1e60-457d-be90-3673900d7cc5.png)

#### Falling back to alternative path when `adb.exe` is the SDK folder
![image](https://user-images.githubusercontent.com/12156624/153605693-0adb9c1b-e77f-44a1-9d2c-00cf40f59645.png)

#### Otherwise failing if `adb.exe` is not found
![image](https://user-images.githubusercontent.com/12156624/153605797-307304d3-e513-459a-9e28-53d95ba94642.png)

Reviewed By: passy

Differential Revision: D34240518

Pulled By: aigoncharov

fbshipit-source-id: db834bbdc9815e5ad41f7a1329ec8d5869f6f24b
2022-02-16 02:59:39 -08:00
Pascal Hartig
1910d3b713 Bump dependencies in /desktop
Summary: Combining green-ticked upgrades from GitHub into one push.

Reviewed By: lblasa

Differential Revision: D34212788

fbshipit-source-id: 12b207a05b9df08eac5b5c58fe1025932c448258
2022-02-14 09:55:15 -08:00
Lorenzo Blasa
dbe818c6e1 Port-forward websocket ports
Summary:
^
Changelog: Port-forward websocket ports

Reviewed By: passy

Differential Revision: D34210187

fbshipit-source-id: 8ec84a9ce89d9982519111417538b7bfa0964cfc
2022-02-14 04:37:21 -08:00
Lawrence Lomax
9973014116 Fix error message when there's no xcode-select'ed Xcode
Summary:
This error messaging is confusing for device only users. These users may only be running against a device **without xcode installed**, which is supported.

However, we also need to handle the case where a user has a sim running and they haven't xcode-select'd as this will mean that the sim is working fine, but the user has no way of knowing why Flipper is not working.

Reviewed By: passy

Differential Revision: D34140277

fbshipit-source-id: f9b035b6c7918424d6131d1dfcdba10acf438fa8
2022-02-11 00:33:48 -08:00
Lawrence Lomax
2a9983b1ef Use Promise.all for checking xcode-select and apps in parallel
Summary: These can be batched together rather nicely

Reviewed By: lblasa

Differential Revision: D34139753

fbshipit-source-id: 7388630dcae34d40308d54f18a37215cf18e5904
2022-02-10 07:59:24 -08:00
Lawrence Lomax
84fac685ac Actually use unit tested function in wrapped xcode check
Summary: Accidentally tested a function that should have been called from the internals. This makes the internal function use the check.

Reviewed By: lblasa

Differential Revision: D34139589

fbshipit-source-id: fac13f7b54ffb0b6f501fb9237f55766706e975a
2022-02-10 07:59:24 -08:00
Andrey Goncharov
3871755064 Fix extracting device ID from the path for iOS simulators
Summary: Changelog: Fix extracting device ID from the path for iOS simulators

Reviewed By: lblasa, antonk52

Differential Revision: D34142876

fbshipit-source-id: 57d3bffcda7bb7b4bf88ea837eb9bf2dc8405764
2022-02-10 06:52:38 -08:00
Andrey Goncharov
c33a5f9bef Fix cert exchange on iOS with multiple devices connected
Reviewed By: lblasa, nikoant

Differential Revision: D34142119

fbshipit-source-id: e5edc4962e75f2e6f91d9ed304ffd080fd29ff27
2022-02-10 05:41:06 -08:00
Liam Jones
8696349593 Fix Xcode version check (#3428)
Summary:
Fixes https://github.com/facebook/flipper/issues/3396 - the Xcode version mismatch check has been broken since 0.132.0.

## Changelog

Fixed Xcode version mismatch check

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

Test Plan: No existing test, manually tested locally on macOS 11.6.3 via `yarn start` when launching the Simulator directly or via `yarn react-native run-ios` in an RN project

Reviewed By: lblasa, mweststrate

Differential Revision: D34139471

Pulled By: lawrencelomax

fbshipit-source-id: 97920de5c463b366ef7ecaef0441ee37debe5d46
2022-02-10 01:48:11 -08:00
Michel Weststrate
d81a9909e0 Fix error that is logged when device disconnected quickly
Summary: If a device disconnects quickly, trying to determine whether screenshots and alike are supported would throw, showing up in our monitoring (see attached tasks). This change fixes that

Reviewed By: nikoant

Differential Revision: D34105451

fbshipit-source-id: 8d3d6dd4c2c82f70cdff710722d789e7c1d73693
2022-02-09 04:22:25 -08:00
Michel Weststrate
597f679ed3 Propagate errors properly when cert exchange fails
Summary:
Certificate exchange errors should be communicated back to the user, as they are often actionable, and otherwise leave users in a stuck state.

Also removed the ServerController interface, upgraded the listener types to get at the necessary internal apis typewise that were already available.

Removed that error wrapping utility complaining about idb installation, this is rarely ever the problem anymore, and it hides the underlying error.

Reviewed By: nikoant

Differential Revision: D34105452

fbshipit-source-id: 3b3cd0b99cecbda26dfd0744a90690fe568a5ea5
2022-02-09 04:22:25 -08:00
Michel Weststrate
4f9cec718e Suppress recurring 'still connecting' errors
Summary:
https://fb.workplace.com/groups/flippersupport/permalink/1304868459993809/

Changelog: Don't show errors for clients that fail to connect in a timely fashion repeatedly.

I think this change is fine, as even once the error is supressed, the clients will show up as 'still connecting...' in the app selector dropdown, which gives the same signal, but a bit less in the face.

Reviewed By: lawrencelomax

Differential Revision: D33976460

fbshipit-source-id: 7c5a02f3cd645ed1cbda47d186798857a05906f1
2022-02-04 01:20:08 -08:00
Andres Orozco Gonzalez
4b6fcb6aaf new look up for adb path
Summary: Look up for the path of the adb may sometimes fail when looking for the folder platform-tools because the adb configuration wasn't done by android studio

Reviewed By: aigoncharov

Differential Revision: D33888687

fbshipit-source-id: 4d0cad2f6b19717e45422632f5d459813a7b7ee0
2022-02-03 07:14:22 -08:00
Michel Weststrate
a31494f321 Fix unnecessary 'still authorizing' error
Summary:
When connection to Android, I always get an error popup with 'device still authorizing', which disappears itself and the device connects fine. It seems that this was a case we handled gracefully before, but the error message we check for has changed. Also updated the log message so that we get it in our monitoring I don't silently get stuck in this state.

Changelog: Fixed 'device still authorizing' errors showing up while connecting to an Android device

Reviewed By: aigoncharov

Differential Revision: D33976028

fbshipit-source-id: dbb055bbbd43bad129b10ffee4a8dbb50be8e87a
2022-02-03 04:20:54 -08:00