Commit Graph

371 Commits

Author SHA1 Message Date
Daniel Büchele
9bf41f7bb7 add GK
Summary:
Users passing the GK `flipper_layout_inspector_new` will see then new layout inspector instead of the old one.

Hopefully users won't realize that they are on the new Layout Inspector. To make them aware of it, I added a bar on the bottom linking to the support group that is used for the GK.

Reviewed By: jknoxville

Differential Revision: D14100392

fbshipit-source-id: 78d561a3ab8ac035e5b439799c395901be086b1b
2019-02-18 05:17:52 -08:00
Daniel Büchele
a8a1869bc8 adding Searchbar
Summary: Adding the searchbar to layout inspector. Most of it's functionality is taken from the existing implementation.

Reviewed By: jknoxville

Differential Revision: D14100533

fbshipit-source-id: 6c3a49658d53c676489886b2599bef425f8f20d3
2019-02-18 05:17:52 -08:00
Daniel Büchele
649688db2a Sidebar
Summary:
This is mostly only moving the Sidebar from the old LayoutInspctor to a separate file. The old file was part of the UI component, however, it was super specific to the layout inspector, so I felt it makes sense moving it there.

Here is a diff between the new `src/plugins/layout/layout2/InspectorSidebar.js` and `src/ui/components/elements-inspector/sidebar.js`: P60951781

The old file is still kept around, as long as the old and new layout inspector are run side by side.

Reviewed By: passy

Differential Revision: D14100537

fbshipit-source-id: b5a6fbae9866732800bb9b2b8fb1b996b9861db6
2019-02-18 05:17:52 -08:00
Daniel Büchele
4f425b05b4 Alignment mode
Summary: Adding a toggle to enable/disable alignment mode

Reviewed By: jknoxville

Differential Revision: D14100534

fbshipit-source-id: e3a49f1f31112ca2c99c2246a12c4f34be1ec61a
2019-02-18 05:17:52 -08:00
Daniel Büchele
53f3f2d40f Target mode
Summary: Adding a toggle to enable/disable target mode

Reviewed By: jknoxville

Differential Revision: D14100535

fbshipit-source-id: 9251f2d2f9d3013650421be62719ad5fb254e804
2019-02-18 05:17:52 -08:00
Daniel Büchele
c21875e168 refactoring
Summary:
This is refactoring the layout inspector. The old layout inspector was a single file with more than 1200 LOC which was really hard to debug and extend. This aims for splitting it up into smaller, easier to maintain components.

This version of the layout inspector only shows the view hierarchy for the regular view tree and the a11y tree. Additional features are added in stacked diffs.

Reviewed By: jknoxville

Differential Revision: D14100536

fbshipit-source-id: ca5e22dbb6ed9e34ce208a2a699ebfeb083904ad
2019-02-18 05:17:52 -08:00
Daniel Büchele
b70a18cef2 ToolbarIcon component
Summary: Adding a ToolbarIcon component that displays an icon in the toolbar that can be toggled on and off. This is used in subsequent diffs.

Reviewed By: passy

Differential Revision: D14100393

fbshipit-source-id: d814b52cf77585c4e8d090e11399e005713efb5e
2019-02-18 05:17:51 -08:00
John Knox
d5dc3f9c2a Add timestamp columns to network inspector
Summary: Adds requestTimestamp, and responseTimestamp which is hidden by default.

Reviewed By: passy

Differential Revision: D14088403

fbshipit-source-id: c451a428d8068c5bfce199cda5502361c12d1667
2019-02-15 04:57:38 -08:00
John Knox
ee54a54ff2 Clean up log statement
Summary: Looks like a left over debug log

Reviewed By: danielbuechele

Differential Revision: D14086508

fbshipit-source-id: 6bf3ef40746d8d248ed38071107cae00ba3040f9
2019-02-15 04:32:43 -08:00
John Knox
d95e81b17d Deprecate client.send()
Summary:
Adds a warning when not in production and client.send() is used.

We could just delete it but there may be open source users of the API.

Reviewed By: passy

Differential Revision: D14085002

fbshipit-source-id: 39f965b59540bd5b7059ec8d6b1c274146699d2d
2019-02-14 09:55:50 -08:00
John Knox
2a938c5b81 Change all plugin uses of client.send to client.call
Summary: client.send will be deprecated because it doesn't allow handling or detection of errors.

Reviewed By: passy

Differential Revision: D14084786

fbshipit-source-id: 7ebe4a7f3f8536c705e1c9302f38db0a34d99dc4
2019-02-14 09:55:50 -08:00
John Knox
e33e2d4d06 Unify Logger interface usage
Summary:
Unified all imports of Logger. Some were called LogManager before.
Now the fb-stub and the fb variants use the same interface.
Constructor of Logger is no longer exposed so it can't be initialized twice, unless in the case you're explicitly using the fb variant, which has extra functionality.

Reviewed By: danielbuechele

Differential Revision: D14083929

fbshipit-source-id: 9b61a06e1264d5f142b5a9188465c99deaf18193
2019-02-14 09:23:41 -08:00
John Knox
8ff4c4f56d Remove duplicate Logger in headless/index.js
Summary:
init() was being misused. This returns a Logger instance, so there's no need to create one as well.
This was a problem because different arguments were being passed to each (isHeadless in this case).

Reviewed By: passy

Differential Revision: D14083320

fbshipit-source-id: b0001a2b3cdd914609d54382575e3b0fa4b5f077
2019-02-14 09:23:41 -08:00
Pritesh Nandgaonkar
b9db2411cf Add archived device type
Summary:
This diff adds archived device type. This diff solves the following two problems.

- The Plugin which are device plugins and are device plugins will not show up. Look at the video, where the CPU plugin was showed, even though the imported file didn't have any information.
- An icon of 📦 will make much clearer which one is archived device and which isn't

Reviewed By: passy

Differential Revision: D14066399

fbshipit-source-id: 59b740d7fe9532e665d6b1ec6ad0124fb63ac45d
2019-02-14 06:34:02 -08:00
Pascal Hartig
c0b5f10693 Add --launcher-msg option to pass to desktop app
Summary:
Allows the launcher to provide messages to the user. Currently, in the form
of the red notification bar at the bottom. This is just meant as a temporary measure
during the alpha to have some clearly noticeable way of getting the user's attention.

I consider removing this a blocker for the release as this mechanism is not well
suited for this in many ways.

The current use case for this is providing a warning if a cached version is used
instead of the requested one, e.g. "Could not fetch requested Flipper version 'deadbeef', using cached version instead."

Reviewed By: jknoxville, priteshrnandgaonkar

Differential Revision: D14073687

fbshipit-source-id: 85630347027063103315eeb1286731fe2478e261
2019-02-14 06:02:44 -08:00
John Knox
3caa0da887 Use call instead of send
Summary: Going to deprecate send, so changing these to call so the plugins can respond to errors.

Reviewed By: passy

Differential Revision: D14066981

fbshipit-source-id: 440563f1bf1a1a145fcfd0e6f36af63bf27836ed
2019-02-14 05:18:19 -08:00
Pritesh Nandgaonkar
9a8e30681b Handle the case of Logs not being present
Summary:
- handles the case when log is not present
- solved the cpu plugin error
- now `fileversion` is the flipper version

Reviewed By: jknoxville, danielbuechele

Differential Revision: D14065882

fbshipit-source-id: f88414bbb3d766f8ab6e0ec00943b59738918a0e
2019-02-14 04:53:56 -08:00
Pascal Hartig
2b9e3c54c6 Set up --no-launcher flag
Summary: For future use to disable launcher loops.

Reviewed By: jknoxville

Differential Revision: D13979653

fbshipit-source-id: db56f7d71d7a4d1322cb36622313dbad4307396d
2019-02-14 02:33:06 -08:00
Pritesh Nandgaonkar
059ac83fcf Do not import already imported data
Summary: Before this diff, if one imported same file twice, it duplicated app data.This diff fixes that. When one tries to import the already imported file then this diff will select that flipper files device in the UI.

Reviewed By: jknoxville

Differential Revision: D14045145

fbshipit-source-id: f17c83486ffcdb0e2a57c70b1589e34567811d01
2019-02-12 08:37:14 -08:00
John Knox
c912dcaf48 Add isHeadless attribute to scribe messages
Summary:
So we can distinguish between humans and the machines.

We can redirect the traffic to different tables based on this attribute if necessary.

Reviewed By: danielbuechele

Differential Revision: D14025004

fbshipit-source-id: c3a24b5f8a30f24445eaee67843b78ddabfc9d51
2019-02-12 08:29:20 -08:00
Pritesh Nandgaonkar
029377a849 Change the export file extension type
Summary: This diff imports and exports data in a `.flipper` file extension. This diff also adds the support to open flipper app by double clicking on the `.flipper` file.

Reviewed By: danielbuechele

Differential Revision: D14042846

fbshipit-source-id: 17e6b55bf2796d9abdf985411fce799600f7792b
2019-02-12 06:48:06 -08:00
Pritesh Nandgaonkar
c28ef62f07 Import and export Logs
Summary: This diff adds import and export support for the logs plugin

Reviewed By: danielbuechele

Differential Revision: D13958713

fbshipit-source-id: a072de025f0b959302175ef0ccaf763ca41377e9
2019-02-12 02:47:55 -08:00
Pritesh Nandgaonkar
e5151b9994 Add salt to the exported device serial id
Summary:
This diff solves the following bug.

When the user imports the exported flipper data for the device which is currently running, there was a bug. A duplicate device with the same serial got created after importing the file. Due to the same `device_id`, the plugins of the exported device got imported in the already running device(which has the same device id).

To solve this problem, I have prefixed the exported `device_id` with a random string, so that the exported device is unique across the device list in the Flipper app.

Look at the vide to understand the bug

Also updated the test case accordingly

Reviewed By: danielbuechele

Differential Revision: D13973180

fbshipit-source-id: df6ee00987e81923914855cea4d76e2bd7167358
2019-02-12 02:47:55 -08:00
John Knox
fe0eeafd98 Fix issue with responses from de-inited plugins
Summary:
Now that flipper is using rsocket requestResponse, the SDK is responding with an error when the connection for this plugin has been torn down.

To avoid flipper interpreting these as bad, keep track of which plugins are inited, and only worry about responses from these.

Reviewed By: danielbuechele

Differential Revision: D13973745

fbshipit-source-id: d4e6916f89b3b562e5dcf23c4fe5b5cb384a6ec4
2019-02-11 14:06:56 -08:00
John Knox
ce5f739d81 Add sdkVersion to ping events
Summary: So we can see usage of old sdks.

Reviewed By: passy

Differential Revision: D14022623

fbshipit-source-id: 22f0681cbf4374e2cf3256e1049d154789e1959e
2019-02-11 14:06:56 -08:00
John Knox
92271d1454 Use rsocket requestResponse in desktop app
Summary:
Changes the desktop app to use requestResponse for communicating with the sdk, when the sdk is on a version that can handle it.
If it's an old sdk version, just use fire and forget. We can delete this code after a while, but keeping it for now to smooth things over during migration.

This should be fully backwards compatible both ways.

Reviewed By: passy

Differential Revision: D13971354

fbshipit-source-id: 60e18dda5c253c81ab7e62ca1aae4f4bc423f7e2
2019-02-11 14:06:56 -08:00
Mitch Ware
8f6138a41c Explicitly specify serial filename to openssl (#227)
Summary:
Manually add `serial.srl` as the `CAserial` param to `openssl`. This
fixes a permissions issue when generating certificates, which fixes some
of the issues explained in #101.
Pull Request resolved: https://github.com/facebook/flipper/pull/227

Reviewed By: passy

Differential Revision: D9316089

Pulled By: jknoxville

fbshipit-source-id: dd15e2f2f318d3a1217c6b4ffd0bb7e25b56d560
2019-02-11 04:58:46 -08:00
Daniel Büchele
c98047bbcf support DEVICE_SET_PATH env var
Summary: support for DEVICE_SET_PATH as used by 1W

Reviewed By: passy

Differential Revision: D14007285

fbshipit-source-id: 79f40355020c67efcb439f470af2fc35ec7fea7e
2019-02-11 02:57:19 -08:00
Daniel Büchele
6431d374c2 get adb config from env vars
Summary:
REact adb config from env vars:
- `ADB_SERVER_SOCKET`
- `ANDROID_ADB_SERVER_PORT`

Reviewed By: lawrencelomax

Differential Revision: D14002603

fbshipit-source-id: e30fa4354ab15048d4350654979fd0b6f394cd89
2019-02-11 02:51:25 -08:00
Pascal Hartig
351ac37fab Log to infinity_analytics_dev scribe cat in non-prod
Reviewed By: danielbuechele

Differential Revision: D13956251

fbshipit-source-id: a741ffc7f39b3a09eeb29b8b96c3a7183f630f84
2019-02-08 11:22:55 -08:00
Daniel Büchele
0ad13a0606 use ANDROID_ADB_SERVER_PORT in adbkit
Summary: Using `ANDROID_ADB_SERVER_PORT` env var to create adbkit instance.

Reviewed By: jknoxville

Differential Revision: D13987361

fbshipit-source-id: 2283b52466f8ad536aa3a8320a4ee8f4ce97321a
2019-02-07 06:36:49 -08:00
John Knox
8a5b5a0cba Allow underscore characters in app name (#368)
Summary:
This whitelist exists to prevent unauthorized code execution. But there's no need to exclude _, which is a valid character in android app names.
Pull Request resolved: https://github.com/facebook/flipper/pull/368

Reviewed By: passy

Differential Revision: D13987022

Pulled By: jknoxville

fbshipit-source-id: 920c5906513af9ba00ae6626b4790dfd021fe4a0
2019-02-07 05:56:37 -08:00
Daniel Büchele
765874f4be no bundled plugins while developing
Summary: While running in dev mode, there are no bundled plugins. This was causing an error messages being logged. Now we early return an empty array to prevent the error.

Reviewed By: passy

Differential Revision: D13971930

fbshipit-source-id: 4110a3ea5d6d2e60b3de17a43d497a3727b8e441
2019-02-06 08:10:43 -08:00
Pascal Hartig
14ae2fea2c Move configuration to module
Summary:
Moves the JSON config access to one module instead of
ad-hoc de-serialising the object all over the place.
This also adds a type for it so we hopefully won't typo things that easily.

Reviewed By: danielbuechele

Differential Revision: D13956612

fbshipit-source-id: 48098deafedf18cc86c8802a3c40fba9394b8262
2019-02-06 03:18:52 -08:00
Pritesh Nandgaonkar
dc9160d05c Use Archived device for test, as IOSDevice registers for log listeners and spits errors in tests
Summary:
Instead of using IOSDevice, used ArchivedDevice, as it doesn't instantiate the loglistener which printed erros in the console when one ran the tests.

Look at the attached task.

Reviewed By: passy

Differential Revision: D13941803

fbshipit-source-id: 3e504a02522719985afaad25caf4d2a576bfc338
2019-02-05 09:36:35 -08:00
Pritesh Nandgaonkar
d70e512889 Show save as dialog for export data
Summary: This diff adds support to specify custom location to save the flipper data to be exported

Reviewed By: passy

Differential Revision: D13916944

fbshipit-source-id: cfe816d07eb505d99c00f7798f3a97a2093ab265
2019-02-05 09:36:35 -08:00
Pritesh Nandgaonkar
9bc54597cf Import from exported file
Summary:
This diff adds the feature to import the exported flipper data. It has the following features

- Dialog to select the file
- Merges the data with an existing store.

Reviewed By: danielbuechele

Differential Revision: D13901944

fbshipit-source-id: 1b9755735419732a34254bdc39d911bcb51ad8fe
2019-02-05 09:36:35 -08:00
Pascal Hartig
259ae35284 Fix ESLint issues
Summary: Accepted the Phabricator suggestions but looks like they weren't actually applied ...

Reviewed By: danielbuechele

Differential Revision: D13958095

fbshipit-source-id: 58f3a374fc76a6e3ebccb87732af0abd0ccd52f8
2019-02-05 09:29:16 -08:00
Pascal Hartig
74a726aaf9 Use yargs for non-headless Flipper args parsing
Summary:
This seems like a better approach than ad-hoc lookup in
`electron.remove.argv`. Left a note to a task to provide
a better interface to this.

I also need this in order to ensure we're starting
Flipper through the launcher which needs to happen
before we start the Electron runtime.

Reviewed By: jknoxville

Differential Revision: D13881355

fbshipit-source-id: 69c70d71035a47084f789ddb4dc969b45ba4648b
2019-02-05 04:49:38 -08:00
Daniel Büchele
3b75fb092b output data on stdout
Summary: listening on `SIGINT` events and putting the serialized store to stdout.

Reviewed By: passy

Differential Revision: D13878051

fbshipit-source-id: 19c1d857a299ed9a474605169c54e5359e0515bd
2019-02-04 07:29:13 -08:00
Daniel Büchele
5b68c59b5c package bundle
Summary:
For the electron build, plugins are bundled with the app and loaded from there at launch. The headless version can't require from its binary, so plugins need to be required from another path.

This diff makes the path where bundled plugins are loaded from adjustable via an environment variable: `BUNDLED_PLUGIN_PATH`. If it's set, the plugins are loaded from this path, otherwise we default to the old behaviour of including them from `./defaultPlugins`.

For the headless version we expect the plugins to be in a folder called `plugins` next to the executable. This should later be configurable via an argument passed to the CLI.

Reviewed By: passy

Differential Revision: D13843676

fbshipit-source-id: 04237ae6631b4f2ba56887fe992a56f860724edc
2019-02-04 07:29:13 -08:00
Pascal Hartig
64c8163a01 Fix screen recording bug on Pixel devices
Summary:
Pixels don't seem to allow modifying the modification time
of files on the "sdcard". You can repro this by getting a Pixel
device and running

```
$ adb shell touch /sdcard/boop
$ adb shell touch /sdcard/boop
touch: '/sdcard/boop': Invalid argument
```

Access time seems to work, strangely enough, but I'd rather
not play games and just create an empty file instead with echo.

Reviewed By: danielbuechele

Differential Revision: D13941381

fbshipit-source-id: 1321482a07a6698aa5eaf71e5a022c8e7dfe0b18
2019-02-04 07:22:38 -08:00
Pascal Hartig
dc412ce0bc Replace ad-hoc home dir expansion with package
Summary:
Instead of replacing the tilde with home-dirs on an incomplete, ad-hoc
basis, let's use a package for this. It also supports `~USER` resolution
which someone might reasonbly expect to work if `~/DIR` is working.

Reviewed By: jknoxville

Differential Revision: D13940956

fbshipit-source-id: 5bfa9b8b2540fed8c05c856ff736e48e925f985d
2019-02-04 04:42:18 -08:00
Pritesh Nandgaonkar
4288a7cfd5 send flipper cpp errors only in non-prod builds
Summary: This diff makes sure that flipper error notifications are triggered only on the non-prod builds. Ideally we should have a preference in the flipper app itself, this we can work out later. As this diff solves the issue posted in the [group](https://fb.workplace.com/groups/230455004101832/permalink/561100837703912/).

Reviewed By: passy

Differential Revision: D13923819

fbshipit-source-id: 6598f00ab3a7b0c4a3b783120e62a1796fe4e5d2
2019-02-01 11:06:46 -08:00
Pascal Hartig
09a93cd9e6 Upgrading flow and fixing lint errors
Summary:
Upgrading to flow 0.91, fixing a bunch of `$FloxFixMe`s that were introduced by upgrading to 0.86.
Also fixing some linting issues.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13900794

fbshipit-source-id: 5d0a1b62371f3b5d34b909bae0876583acb6f977
2019-02-01 06:51:01 -08:00
Daniel Büchele
88cc299811 don't trim messages
Summary: Don't trim messages to allow indentation using spaces. (e.g. for dispalying hierarchical data)

Reviewed By: jknoxville

Differential Revision: D13895630

fbshipit-source-id: 2c0e075bdecb6ab850a8ed7ed52c8423fa9343f2
2019-01-31 05:47:35 -08:00
Pritesh Nandgaonkar
0e8b1a7d1a Expose crash reporter plugin to open source
Summary: Exposes crash reporter plugin and export data functionality to open source

Reviewed By: passy

Differential Revision: D13879149

fbshipit-source-id: ee10097cc9ff1af11e0350f50c855d7766076cd1
2019-01-31 04:03:48 -08:00
John Knox
77811c66d2 Add reportPluginFailures in client.call method
Summary:
Adds an optional "plugin" field to the tracked metrics. The idea is to be able to see failures in plugins.

Added it around all desktop -> sdk "call"s, so it won't require any effort from developers but we'll get lots of immediate data. E.g. How often layout -> getNodes fails. I think we can go modify the existing pipeline to take both platform and plugin data so we can get session roll-ups too.

Corresponding change to the puma app: D13882629, adds a plugin field to all tables so we can filter by plugin, or null for platform failures.

I'm thinking it will be worthwhile to expose some method to plugin developers, that lets them explicitly track failures. It would be better if it encapsulated their plugin id etc, so they just need to say what failed. But that can be done any time, I don't have any particular use cases in mind yet.

Reviewed By: passy

Differential Revision: D13878379

fbshipit-source-id: 2e2ef6b98f763e6edcfe937741d6988dae4b92d1
2019-01-31 03:23:41 -08:00
John Knox
6d50843eed Rename recordSuccessMetric to reportPlatformFailures
Summary: Change from `recordSuccessMetric` to `reportPlatformFailures`, because the next diff adds `reportPluginFailures` and I want to distinguish the two.

Reviewed By: passy

Differential Revision: D13878380

fbshipit-source-id: 9c6b8bfe1ed2e1a8bbe5aacbec31d24e9aa39171
2019-01-31 03:23:41 -08:00
Pascal Hartig
1101306249 Move FLIPPER_PORTS error handling out of function
Summary:
The function itself can easily be pure. Let's have the side-effects
(lookup of env variable and error handling) outside of it. Also
prevents spam in the test log (which I intend to make a test failure
going forwards).

Current output:
{F149794656}

Reviewed By: jknoxville

Differential Revision: D13894995

fbshipit-source-id: dacf51f8b35cb427740f9566ef993ffc6b2c3906
2019-01-31 03:16:55 -08:00