Commit Graph

127 Commits

Author SHA1 Message Date
Andrey Goncharov
d515342526 Add FlipperServerDisconnectedError to prevent excessive error logging
Reviewed By: passy

Differential Revision: D51393196

fbshipit-source-id: f49857b397a3fb629ad44f89a4c59b12ba2f67c4
2023-11-16 04:18:41 -08:00
Anton Kastritskiy
d023bcc42e remove shortcuts
Reviewed By: aigoncharov

Differential Revision: D51159922

fbshipit-source-id: fbb59b416f92b9156c74a12247da8d0df07f1a4e
2023-11-10 04:33:02 -08:00
Andrey Goncharov
d54bd7c3ba Refactor browser connection performance tracking
Reviewed By: lblasa

Differential Revision: D51158256

fbshipit-source-id: 17e020dd3c26ac73bf2cf0ceb4c664638c6778e9
2023-11-09 08:25:28 -08:00
Anton Kastritskiy
39b1b37172 Off vpn error banner
Summary:
Some features of bloks do not work off vpn.

Until we figure out how to make them off vpn

Reviewed By: LukeDefeo

Differential Revision: D51076469

fbshipit-source-id: c83d96e89d33d245845312b39928a7460a235217
2023-11-07 10:57:06 -08:00
Andrey Goncharov
aea77cc4da Hide PWA app from Spotlight
Reviewed By: LukeDefeo

Differential Revision: D50411182

fbshipit-source-id: 46c089c69aefb58f85a861c7898ee355f094e03c
2023-10-20 05:13:20 -07:00
Anton Kastritskiy
683fbfd6fb doctor result can display copiable CLI commands
Reviewed By: lblasa, ivanmisuno

Differential Revision: D50383150

fbshipit-source-id: 201f239cc7d69bd03011ec817156163f9f6ed653
2023-10-18 05:55:23 -07:00
Anton Kastritskiy
73862c9408 refine typescript type of tryExecuteComand
Summary: You can now descriminate based on `hasProblem`. Thus removing asserting operator

Reviewed By: LukeDefeo

Differential Revision: D50366398

fbshipit-source-id: a16a5419ce946831bd2d1624b1baa75c89a47aa3
2023-10-17 16:01:08 -07:00
Luke De Feo
eb86eb910f quieten some errors
Summary:
message format has changed slightly
T164418118

Reviewed By: lblasa

Differential Revision: D49502179

fbshipit-source-id: 205ebf5bfe444fb0ce768fa635f9de5371d82a03
2023-09-21 08:50:36 -07:00
Pascal Hartig
777632b841 Add logging and fallback for failing vpnless requests
Summary:
If a requests fails due to lack of allow-listing or other incompatibilities, we will now fall back to VPN mode while logging an error that will hopefully end up at the plugin owner.

For this, there's a new `vpnMode` option on every request that can also be used to enforce a particular type.

There's a lot of verbose logging that's turned off by default but very handy when debugging. Also potentially useful for plugin authors that are looking into request issues.

Reviewed By: lblasa

Differential Revision: D49023365

fbshipit-source-id: 755393063e379587feda9ae13973877780a1d987
2023-09-11 03:28:06 -07:00
Lorenzo Blasa
3e8f94ceda iOS get devices/targets/simulators cleanup
Summary: ^

Reviewed By: passy

Differential Revision: D48781211

fbshipit-source-id: 71133c07d15ca6a380d85e582d55cbdb192b5a19
2023-08-30 04:24:05 -07:00
Pascal Hartig
50d31cb1f7 Demote "Document not focused" error from Electron
Summary: Comes from Electron. Will go away with PWA.

Reviewed By: lblasa

Differential Revision: D48778132

fbshipit-source-id: 0cecdc38e76b663315434aec995635afca2959dc
2023-08-30 03:15:44 -07:00
Pascal Hartig
c91652d5de Don't throw errors for Watchman not found
Summary: Changelog: Don't throw an error if Watchman was not found

Reviewed By: aigoncharov

Differential Revision: D48778121

fbshipit-source-id: bfe3599e41d8c6fbe4ea89393ace5213914a2611
2023-08-29 09:49:56 -07:00
Pascal Hartig
554d2f9b83 Bump ES level to 2021
Summary: Updating the remaining tsconfigs to build for an ES2021 target.

Reviewed By: antonk52

Differential Revision: D48687661

fbshipit-source-id: 2761704d251f701594ca5d362a17731f287088ed
2023-08-29 05:06:18 -07:00
Pascal Hartig
d4d8c965eb Show iOS version in launcher
Summary:
A little hacky because we currently have too many implementations for getting devices but lblasa is working on cleaning this up. Once that's done, we should add some tests for this.

Changelog: Show the iOS version of simulators in the launcher window

Reviewed By: lblasa

Differential Revision: D48777923

fbshipit-source-id: 18846520feba8eb10b6417f87bd802ffaabb1dff
2023-08-29 04:55:46 -07:00
Pascal Hartig
bb4090f529 Make intern headers configurable
Summary: The one-off hack for slog makes this hard to refactor, so I've added a headers field, putting the caller in charge of this.

Reviewed By: LukeDefeo

Differential Revision: D48564065

fbshipit-source-id: f8e78e9b8597fd3131bf3741197e6179807ad5da
2023-08-23 07:40:49 -07:00
Lorenzo Blasa
e7b6882ef2 ScribeLogger moved to common
Summary: There's nothing specific nor private about the ScribeLogger, so it is moved to flipper-common.

Reviewed By: LukeDefeo

Differential Revision: D48556074

fbshipit-source-id: aa9446036fd07fe6e6debc5a978a42308fc93fe0
2023-08-22 06:03:26 -07:00
Lorenzo Blasa
b69358f6a2 Remove the previous misplaced log tailer
Summary: The log tailer is already defined in flipper-common, use that instead.

Reviewed By: passy

Differential Revision: D48524909

fbshipit-source-id: 1c0674276f08893ea80dc2fc9f8b45679f33e93e
2023-08-22 05:16:20 -07:00
Lorenzo Blasa
64a4b3a899 Log tailer moved to flipper-common
Summary: Log tailer is/could/will be used in different places, move to a centralised place.

Reviewed By: antonk52

Differential Revision: D48524579

fbshipit-source-id: 81d6c4670572284ba2821a93011f5daa133b21fa
2023-08-22 05:16:20 -07:00
Lorenzo Blasa
17cfa0e571 Session Id moved to server config
Summary:
Session Id should be shared between client and server, but it was defined deep in the client (redux store).

The proposed solution presented below is to move the session id to the server configuration. By doing this, it becomes available to both server and client VERY early in the application life-cycle for both Electron and non-Electron builds.

Reviewed By: LukeDefeo

Differential Revision: D48520367

fbshipit-source-id: ca959b27ab18b1a2e4cd2fac1d28545664f1b514
2023-08-22 05:16:20 -07:00
Lorenzo Blasa
ff6f98fc0d Import File implementation
Summary: Implementation was missing for the browser. This provides a default implementation.

Reviewed By: aigoncharov

Differential Revision: D48311198

fbshipit-source-id: fd067600f571234e0fbccfb90853b62f175ff8fb
2023-08-14 11:33:06 -07:00
Andrey Goncharov
359392a44c Match isProduction definitions
Summary:
Match isProduction definition in flipper-common and flipper-server/src/index.tsx.

Without it, PWA never quits after all clients disconnect because Flipper Launcher does not set NODE_ENV to production currently (changed in the next diff)

Reviewed By: LukeDefeo, lblasa

Differential Revision: D48265768

fbshipit-source-id: 59e4660cb57da20b606562144c47c65276999d6c
2023-08-11 10:56:38 -07:00
Lorenzo Blasa
2c24ec9f5d Add OS to record
Summary: OS will become useful later on, add it.

Reviewed By: antonk52

Differential Revision: D47989161

fbshipit-source-id: 3615544051b163b77f87e5c52e6ac9cae8c478d4
2023-08-02 07:56:17 -07:00
Lorenzo Blasa
d43173a8df adb kill-server
Summary: Introduce a new command to allow killing adb

Reviewed By: antonk52

Differential Revision: D47988522

fbshipit-source-id: bb4f17faa7f9b31b9d42e45c0ce39b3f5d98f4b3
2023-08-02 07:56:17 -07:00
Lorenzo Blasa
143fe0e719 Cmd failures should be displayed as errors too
Summary:
Styles are applied depending on entry type. This was an issue when we had 'cmd' as a type too.

So, let's simplify and keep type to denote info, warning, or errors.

Later on we can add a different tag if we want to differentiate between logs, command, others.

Reviewed By: passy

Differential Revision: D47912857

fbshipit-source-id: 213a0768a95f63cbd692ba96f6745ab740346a58
2023-07-31 05:16:54 -07:00
Lorenzo Blasa
1f63a25027 idb kill
Summary: Introduce a new command to allow killing idb

Reviewed By: lawrencelomax

Differential Revision: D47911709

fbshipit-source-id: 970f1147a177bbcca0bdfa9e9ba970cdc8a914a3
2023-07-31 03:55:58 -07:00
Lorenzo Blasa
1f53c167ab Dedicated connectivity troubleshoot notification
Summary:
There's a generic notification server event.

This change introduces a new notification server event dedicated for connection troubleshoot.

The difference is, this notification will have a button to troubleshoot the issue. Additionally, in the future, we may even be able to add a payload so that we can troubleshoot the exact problem.

Reviewed By: antonk52

Differential Revision: D47873697

fbshipit-source-id: 28843a08836d0054909f6b9ab7a88b14b8a1b868
2023-07-28 10:25:17 -07:00
Lorenzo Blasa
60b3ff99ce Troubleshoot FlipperServer support
Summary: Add neessary types and events to troubleshoot connectivity.

Reviewed By: antonk52

Differential Revision: D47293373

fbshipit-source-id: 9ffbe07e5c71ba0d8ab1c58cd322eaab22141f12
2023-07-10 05:52:07 -07:00
Lorenzo Blasa
e052c27f27 Remove ClientCsrQuery
Summary: Already have SecureClientQuery. No need to have this as a type as it's not used or needed anywhere.

Reviewed By: antonk52

Differential Revision: D47210345

fbshipit-source-id: d9f3026a0e2a0b5dd2e87f16dba34a388dacd75f
2023-07-04 09:01:26 -07:00
Lorenzo Blasa
4a0ad8c1c3 SecureClientQuery moved to flipper-common
Summary: It should've been there with ClientQuery.

Reviewed By: antonk52

Differential Revision: D47210314

fbshipit-source-id: 869496918648f20b616c1a612296fff55597af77
2023-07-04 09:01:26 -07:00
Lorenzo Blasa
2f9e633fad Medium refactoring
Summary:
Simplifies medium usage. Clients report this value as an integer. Internally, we transform this integer as type (a set of valid strings).

Instead of transform this value in different places, do it once when the client query is received.

Reviewed By: antonk52

Differential Revision: D46358024

fbshipit-source-id: ecd2b6c6ccbe7c38787a89d4e2f81930c7b91864
2023-06-02 03:59:15 -07:00
Andrey Goncharov
5ca9107d0c Expose SKIP_TOKEN_VERIFICATION to frontend
Summary: It is hard to pass auth token to Jest E2E tests.

Reviewed By: lblasa

Differential Revision: D46279204

fbshipit-source-id: ee0138c3bd014bafb416f7fa8951fb25b25b4067
2023-05-30 09:47:19 -07:00
Ranesh Saha
7a28ed1fe5 Pipe through --updater/--no-updater flag for flipper.exe (#4277)
Summary:
In our organization, Flipper is distributed in a version controlled way. As a result, we do not want users to manually update or receive prompts to update when a new version is available. There is already a `--updater` flag in the command line arguments for flipper.exe, but it isn't piped through. This change pipes it through and disables all update related UI when `--no-updater` is passed in.
## Changelog

Support --updater and --no-updater options for flipper.exe

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

Test Plan: Ran `yarn build --win` in flipper/desktop, and launched flipper.exe from flipper/dist/win-unpacked with the `--updater`, `--no-updater` and no flags and ensured the proper behavior was observed (update UI shows by default or when `--updater` is specified, and doesn't show when `--no-updater` is specified).

Reviewed By: passy

Differential Revision: D41298321

Pulled By: mweststrate

fbshipit-source-id: 5ddfede2700954f0fdd6a111b20d0836fab25565
2022-11-15 03:23:55 -08:00
Lorenzo Blasa
587f428cf8 Allow plugins to use css
Summary:
Flipper plugins fail when importing css from third-party dependencies. This diff tries to fix that.

Effectively, the plugin can import the css and export it when is bundled.

When we load the plugin, we check if there's a css file for it. If there's one, we return it and try to use it.

Reviewed By: aigoncharov

Differential Revision: D40758178

fbshipit-source-id: e53afffcc481504905d5eeb1aea1f9114ee2a86b
2022-10-27 22:50:30 -07:00
Andrey Goncharov
970c03d942 Add uploading to internal cloud storage
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

We'll use it in the subsequent diff to automatically upload a universal export

Reviewed By: passy

Differential Revision: D40585810

fbshipit-source-id: 5b409d716c2ead040865130d379d4f593cb68483
2022-10-25 05:31:48 -07:00
Andrey Goncharov
6af6652ab2 Export data for the universal export as a single zip archive
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

It is better UX not to prompt a user multiple times to save various pieces of the debug export

Reviewed By: passy

Differential Revision: D40550084

fbshipit-source-id: 51ea3acee7daf5074682219020e1e1eed2182b7d
2022-10-25 05:31:48 -07:00
Andrey Goncharov
480a3d26f0 List contents of Flipper folder on Android
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

In later diffs, we'll start fetching the actual files as well. The list of available files itself might be useful already to see what we have in our folder on the device

Reviewed By: passy

Differential Revision: D40508960

fbshipit-source-id: 96193fef3fed64d509cd3397513ae3e94438ae22
2022-10-25 05:31:48 -07:00
Andrey Goncharov
2db9bccf75 Export client logs for the active client as a part of the universal export
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Introduce a command rto fetch debug data from the devices

Reviewed By: passy

Differential Revision: D40470838

fbshipit-source-id: 40a7ec66b1266ceff1b31b5b4f19b93765b78615
2022-10-25 05:31:48 -07:00
Andrey Goncharov
9597e672a1 Provide @emotion/css to plugins
Summary: Changelog: Provide `emotion/css` to plugins

Reviewed By: antonk52

Differential Revision: D40057817

fbshipit-source-id: 1e931eb8527d62dd4312556a6d493fdf3e17b45a
2022-10-04 05:07:36 -07:00
Andrey Goncharov
228de6c542 Add custom timeout to Device.installApp
Reviewed By: lblasa

Differential Revision: D39728545

fbshipit-source-id: be77a2e7ddac4071c9cafc88e67b793ee8c7631c
2022-09-23 10:20:53 -07:00
Ken Yee
fa9ba6f2d0 Adds a notifyAvailableUpdate flag to config.json to disable update (#3992)
Summary:
We would like to version control Flipper and some of our custom plugins that are installed on developers' systems.
Flipper by default prompts users to upgrade so they sometimes do the update and then all our custom plugins break because they were compiled for an older version.
See https://github.com/facebook/flipper/issues/3947 for feature request info.

## Changelog

Adds notifyAvailable flag to config.json to disable prompting for users that "an update is available"

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

Test Plan:
Tested by running locally.
Had to comment out the isProduction() check to confirm this it worked properly because this flag is false on dev versions.
Couldn't figure out how to manually test the handleOpenPluginDeeplink.tsx change but made a similar change there; happy to test that if you can tell me how to exercise that path.

Reviewed By: antonk52

Differential Revision: D39654481

Pulled By: antonk52

fbshipit-source-id: cef6b48d870915c48f620269c42d24b8ef1f4c29
2022-09-21 09:47:44 -07:00
Andrey Goncharov
8716761cb3 Fix require monkey-patching in electron build
Summary:
In D39311893 (094c5bdfdd) we started monkey-patching `require` to resolve global dependencies in the plugins. Apparently, patching `globalThis.require` did not work in the electron env. On my local machine it kept working because I had the experimental `flipper-server` feature enabled which embeds flipper-server into the electron build. In flipper-server we properly patch `require` via `Module.prototype.require` which affected the global require in electron.
With this fix we now properly patch require in electron via Module.prototype.require all the time

Changelog: Fix plugin loading with experimental flipper-server disabled

Reviewed By: nikoant

Differential Revision: D39633821

fbshipit-source-id: 9554f643c625620d116075ae87f573d8447850f6
2022-09-20 01:36:56 -07:00
Andrey Goncharov
094c5bdfdd Provide external modules to plugins
Summary: esbuild references external modules via `require`. We wrap `require` to point the references to built-in modules to global variables

Reviewed By: lblasa

Differential Revision: D39311893

fbshipit-source-id: a99480161c082f4095d78c22271f114532f32c16
2022-09-15 10:02:19 -07:00
Andrey Goncharov
650ff4bcfb Remove plugin bundling
Summary: Remove the notion of bundled plugins

Reviewed By: lblasa

Differential Revision: D39308888

fbshipit-source-id: aa88ddbf2801ad1da95f89e4c761259b697b0d66
2022-09-15 10:02:19 -07:00
Andrey Goncharov
a888e6affa Simplify bundled plugin setup
Summary: Stop bundling plugins into Flipper Server bundles. In later diffs, we will start building all plugins even in dev mode which removes the need to bundle them.

Reviewed By: lblasa

Differential Revision: D39276249

fbshipit-source-id: 091405cfcf58aa7e1bd2b382da40f8d9841ae6b1
2022-09-15 10:02:19 -07:00
Feiyu Wong
3ffb25e672 Update UI for enabling persisted logs feature
Summary:
This is the first diff to implement the feature for the Flipper logs plugin to have an option to persist logs in the table between crashes, disconnections, etc.

Since this is not a local change, the UI option for persistence will be located in the settings for the Flipper UI(as seen in the test plan). The setting is associated with the Redux Store `Settings` and is stored globally to be used across all plugins. So the plan is making the persistence pertain to all plugins.

Reviewed By: mweststrate

Differential Revision: D37786988

fbshipit-source-id: 7ffc6077cbca559b3401b16770eda657a6c45620
2022-07-28 13:56:34 -07:00
Lorenzo Blasa
c91c766b12 FlipperServer new plugin marketplace methods
Summary:
Expose two new methods as to be able to:
- List plugins from marketplace
- Install a plugin from marketplace

Reviewed By: passy

Differential Revision: D37749817

fbshipit-source-id: 82b78f7906c5664d5747289fa4f8eadebcde1d73
2022-07-11 07:04:55 -07:00
Lorenzo Blasa
ea958b0b15 MarketplacePluginDetails into flipper-common
Summary: ^

Reviewed By: antonk52

Differential Revision: D37715921

fbshipit-source-id: 05d35c472e847a7891fd4af1e88a3425e1d55f13
2022-07-11 02:39:49 -07:00
Lorenzo Blasa
caa04f4a44 Move User to flipper-common
Summary: Move User from reducers to flipper-common. User will now be usable by other modules.

Reviewed By: passy

Differential Revision: D37599802

fbshipit-source-id: 66412e7ed00bf27448fa2deae70f0e8e80303aba
2022-07-08 14:17:52 -07:00
Luke De Feo
6c5faf2932 Add command to install app to flipper server
Summary: There is a new flipper server command to install apps. For android it uses adb (via adb kit) For ios depending on idb availablity it will use idb or xcrun. Consumed in the next diff

Reviewed By: lblasa, aigoncharov

Differential Revision: D36936637

fbshipit-source-id: e09d34d840a9f3bf9136bcaf94fb8ca15dd27cbb
2022-07-07 07:50:14 -07:00
Andrey Goncharov
dcbc7c40bb Stream server logs to browser
Summary: Makes Flipper Logs tab functional for Flipper Browser

Reviewed By: lblasa

Differential Revision: D37459924

fbshipit-source-id: 4ebf3d47fbbf90bb367e01986b12dec782b03c34
2022-06-28 06:27:43 -07:00