Commit Graph

482 Commits

Author SHA1 Message Date
John Knox
deff5e96db Display nicer titles for Mac and Windows Device
Summary: MacDevice and Windows device show uncapitalized 'desktop'. Changing them to Mac and Windows.

Reviewed By: passy

Differential Revision: D15168726

fbshipit-source-id: a69ef572d92f82215e548f71e72ef5d7d48beefa
2019-05-02 04:06:43 -07:00
Daniel Büchele
fca7bc93ee horizontal scrolling
Summary:
Adding a property `horizontallyScrollable` the `ManagedTable` that enables horizontal scrolling, if that is required by the table's contents.
By default this behaviour is disabled to not break existing tables.

Reviewed By: jknoxville

Differential Revision: D15166144

fbshipit-source-id: 7a9b76facdbe717deb3d097e0b8883d4b0732d51
2019-05-01 09:32:32 -07:00
Pritesh Nandgaonkar
e7200e36a3 Learn more points to getting started
Summary:
`/docs/understand.html` doesn't exist anymore. Also "learn more" in the landing page pointed to `/docs/understand.html` which was broken. Pointed "Learn More" to getting started doc page.

`/docs/understand.html` explained about rsocket which will be little overwhelming for the user to be navigated to right from the landing page.

Also removed the links pointing to  `/docs/understand.html`

Reviewed By: passy

Differential Revision: D15147954

fbshipit-source-id: cbd67d7f234c438507f24db946cd463e8827cb78
2019-04-30 09:46:32 -07:00
Zoltán Gilián
d9bb1c5cf1 Add MacDevice
Summary:
Add a desktop device on MacOS similar to WindowsDevice (see D8861986).
This makes it possible to view Oculus Service Log files on MacOS too.

Reviewed By: danielbuechele

Differential Revision: D15147501

fbshipit-source-id: 8a076964e6111bf3786818b7cbd8bb7f81c1498d
2019-04-30 07:18:28 -07:00
John Knox
bc993596ca Include error messages in success-rate metrics
Summary:
At the moment, we can see the %-success of instrumented operations, but it's hard to attribute the ones that fail to actual errors.
This will allow us to see for every session-event row, the error messages that caused each of the failures.

Then if necessary, you can search for that error message in logview to get more info like the stack trace.

Requires a corresponding change in puma, since this is changing a number to a json value.

Reviewed By: danielbuechele

Differential Revision: D15099185

fbshipit-source-id: b966e6e55ab82f1cb9a4cfd7bf02034a1df01929
2019-04-29 08:46:29 -07:00
John Knox
f00ff72211 Allow null TableRow sidebars
Summary: Makes the API a bit easier to use. Don't have to build an empty sidebar if you don't want one.

Reviewed By: passy

Differential Revision: D15064205

fbshipit-source-id: bd31c1aa97fd6d1c93717c10b268f49e44eb1299
2019-04-26 09:29:42 -07:00
John Knox
0a3805c0f4 Add types for native table plugin persisted state reducer
Summary:
I haven't done this at the platform level (plugin.js) because the persistedStateReducer method signature prevents it unfortunately.

We might want to add a different method type at some point, like this one so you don't need to do this unsafe casting in the plugin itself, but for now, just doing it here.

Reviewed By: danielbuechele

Differential Revision: D15080331

fbshipit-source-id: c51749ac84cd38559d85089557f44ace8ae6e08b
2019-04-26 04:08:55 -07:00
John Knox
a4164c89a0 Fix emulator usage on linux
Summary: emulator isn't on the path in CI machines, but we already have ANDROID_HOME set so we can work out where it is.

Reviewed By: danielbuechele

Differential Revision: D15080422

fbshipit-source-id: 2c50a3de27909d2bfc82ea0210d06a0cc32357d7
2019-04-26 03:45:35 -07:00
Benny Wong
221bf1cc75 Fix error message when switching between device and simulator
Summary: Currently, you get an error when you don't have device utils installed. However, when you switch your flipper to a supported device, the error may not be cleared. This handles that case.

Reviewed By: jknoxville

Differential Revision: D15087620

fbshipit-source-id: 6060752b54161c7610656531d053ecbcdd9e978a
2019-04-26 03:41:20 -07:00
Pritesh Nandgaonkar
2359d22b46 Fix Analytics
Summary: We were missing to log for those cases when we exported through sharable link. Also I changed logging a bit so that we can differentiate between Sharable Link and File exports

Reviewed By: jknoxville

Differential Revision: D15080292

fbshipit-source-id: 063e9f515e4f089ed3715e7b1ca0e66410e46541
2019-04-25 10:39:14 -07:00
Pritesh Nandgaonkar
afd729deb6 Added metrics argument to headless inorder to export metrics
Summary:
This diff makes headless flipper accept `metrics` argument. Once this is passed. The headless flipper will terminate to export the metrics of the plugins, the type of the export looks like the following.

```
export type MetricType = {[metricName: string]: number};
type MetricPluginType = {[pluginID: string]: MetricType};
export type ExportMetricType = {[clientID: string]: MetricPluginType};

```

This diff, uses the store to export the metrics. I will modify the logic to accept the data which gets exported through `exportData`

Reviewed By: passy

Differential Revision: D14933499

fbshipit-source-id: dade5b7bc59ea4beb6d16c5ef471737e8597358a
2019-04-25 07:41:34 -07:00
Benny Wong
d9d1346c12 Add copy as cURL for network requests (#415)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/415

This diff adds a context menu item for network request rows that allows the user to copy the request as a curl command. The logic for the command generation was inspired by [`FLEXNetworkCurlLogger`](https://github.com/Flipboard/FLEX/blob/master/Classes/Network/FLEXNetworkCurlLogger.m)

Resolves #406

Reviewed By: passy

Differential Revision: D14973754

fbshipit-source-id: a57c31190d7615ca5377308e0bfad521b645b2e4
2019-04-23 07:05:19 -07:00
Benny Wong
01e4d694b5 Refactor types and util functions
Summary: Separating out the types and utils for work I'm doing on https://github.com/facebook/flipper/pull/415 / D14973754. This will make the request to curl utility function much cleaner

Reviewed By: jknoxville

Differential Revision: D14976747

fbshipit-source-id: cc15c10103ea75945d0a2ebaaa6d32a376192961
2019-04-17 12:23:51 -07:00
Pascal Hartig
6db83a7675 Use ToggleSwitches for binary options
Summary:
We've had a bunch of different options that were all binary
switches with very different ways of displaying them.

This consolidates them all to use ToggleSwitches. I think it
may still make sense to move them all to a sidebar as it's
the case for the Analytics plugin, but that's for another diff.

Reviewed By: danielbuechele

Differential Revision: D14933392

fbshipit-source-id: 7ef286b61142a564a7cde6de875266ac8641704b
2019-04-17 10:31:21 -07:00
Pascal Hartig
c244946be3 Catch malformed URI content
Summary:
As seen in https://our.intern.facebook.com/intern/bug/653953588368620/,
the network plugin can crash if content doesn't look like a URI.

Ideally, we'd be more granular in catching this, but for now skipping
that content seems better than crashing the entire plugin page.

Reviewed By: danielbuechele

Differential Revision: D14971610

fbshipit-source-id: 2708e5c0d4d1f584419d24c7dc38438009015565
2019-04-17 10:24:48 -07:00
Jiyue Wang
614f48dda3 Show server execution time in network plugin
Summary: the simpliest approach to render this metadata for debugging purpose

Reviewed By: bcuccioli

Differential Revision: D14974129

fbshipit-source-id: d816d1ef8dcd1bc333c4d0cdf70d6d9fb925bc03
2019-04-17 10:08:20 -07:00
Pritesh Nandgaonkar
5169d318de Fix the callstack sent from error reporting runnable
Summary:
The crash logged from `ErrorReporterRunnable` wasn't detailed. For example look at the following video.
Also for some reason the `FlipperConnection` interface doesn't have an argument for crash name. Thus I changed the js side of the plugin to accept `crash.name` to be undefined.

{F155526537}

Reviewed By: passy

Differential Revision: D14852561

fbshipit-source-id: 6daf9847535b4508fa312b4f940b014911aae2e5
2019-04-15 05:51:37 -07:00
Pascal Hartig
b276088f5f Refactor debug logging
Summary:
I dislike the sprinkled eslint ignores. Let's put this
in one place and just depend on isProduction().

Reviewed By: jknoxville

Differential Revision: D14913057

fbshipit-source-id: 2f5a98b7dba1ac1829eaeab24290d2f66820edf9
2019-04-14 02:29:42 -07:00
John Knox
460260d620 Fix samsung "run-as" warning (#413)
Summary:
During client setup, if no device is found with a matching CSR, and any of those devices errored while trying to find that out, surface that error, instead of a generic 'No matching device found'.

This means that the warning about some unusable samsung devices now shows again, instead of a generic message.

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

Reviewed By: passy

Differential Revision: D14891185

Pulled By: jknoxville

fbshipit-source-id: 8f4cb4e8e04defb429a4ca915b0dab4725495c87
2019-04-11 05:29:52 -07:00
Zhang Qichuan
ffc6a5fe18 Fix issue 408 (#411)
Summary:
Fix https://github.com/facebook/flipper/issues/408
Pull Request resolved: https://github.com/facebook/flipper/pull/411

Reviewed By: danielbuechele

Differential Revision: D14802001

Pulled By: jknoxville

fbshipit-source-id: 5ce435c0c941a715f799c75a8e09dbf4983e9789
2019-04-11 04:38:52 -07:00
Pritesh Nandgaonkar
25f82986ea Avoid triggering notification in headless
Summary:
There was a bug where headless version used to crash when crash reporter plugin used to get messages. So the problem was that it tried to trigger the notification in headless version, which obviously won't work.

Solves this [bug](https://our.intern.facebook.com/intern/sandcastle/log/?instance_id=88210824&step_id=773963185&step_index=5&name=Get+headless+and+run+it)
Bug:

{F155634920}

Reviewed By: jknoxville, danielbuechele

Differential Revision: D14874122

fbshipit-source-id: 2614b16665a354be7a75844a372dbea7a59d7e55
2019-04-11 04:08:59 -07:00
Daniel Büchele
1d3559c759 Remove beta bar from layout plugin
Summary: I though I already did this, when releasing it. Apparently not.

Reviewed By: jknoxville

Differential Revision: D14854810

fbshipit-source-id: 4da61866925e06a415bfaed0f48e5434e769ec39
2019-04-10 10:33:41 -07:00
John Knox
c198612303 Add top and bottom toolbars to table plugin
Summary: Adds ability to add things above and below the table when using native plugins.

Reviewed By: passy

Differential Revision: D14850839

fbshipit-source-id: cc7fa6d8055900c29f5af6f3460bc280c0a4a675
2019-04-10 06:17:51 -07:00
Daniel Büchele
c4a8e73543 Don't throw if selectedPlugin doesn't exist
Summary:
When a plugin was selected the last time Flipper was running, but is not available anymore, Flipper was still trying to load the plugin and failed.

Now, if the selected plugin is not available, we just don't render anything.

Reviewed By: jknoxville

Differential Revision: D14854930

fbshipit-source-id: 9ddec47becce7bffcf93b3f4a092a8fcf2022f4f
2019-04-09 11:05:38 -07:00
John Knox
40b1c569ad Undo nativeplugin changes to createTablePlugin.js
Summary: Now that it has been inlined into TableNativePlugin, I'm reverting it back to it was before to keep it simple.

Reviewed By: passy

Differential Revision: D14800383

fbshipit-source-id: 81725134b6598c03e3ddfb1eb9269d463815dc82
2019-04-09 06:42:31 -07:00
John Knox
287cad2f4b Inline createTablePlugin for native plugins
Summary: Before expanding what a table plugin can do, I'm extracting the createTablePlugin functionality into the native plugin component, so it can evolve independently without lots of forks in the code.

Reviewed By: passy

Differential Revision: D14800313

fbshipit-source-id: dbb34fe974c507663151daeb6631d1911b46f6df
2019-04-09 06:42:30 -07:00
Daniel Büchele
6741c55b72 fix "cannnot convert object to primitve value"
Summary:
The `instanceof Object` check was throwing an "cannnot convert object to primitve value" error, for some reason that I didn't fully understand. Replacing this check with a `typeof` check. However, `null` also returns `object`, so we are explictly checking this as well.

This was the error that happened before, on every POST request:
https://pxl.cl/vc6K

Reviewed By: passy

Differential Revision: D14827145

fbshipit-source-id: 999480db9afb1e0cc0d1bef73fb0cb2223fa0bc4
2019-04-08 03:09:38 -07:00
Pascal Hartig
ad4c2092a5 Replace launcher error bar with titlebar indicator
Summary:
When starting Flipper with `--launcher-msg`, it currently shows a red error bar at the bottom. That's not ideal for various reasons including it looking kinda bad and it only supporting a single error (the last one set).

This instead adds an action that shows an indicator next to the version at the top as we had it before with the previous system.

Reviewed By: danielbuechele

Differential Revision: D14778859

fbshipit-source-id: 28591de6262e090a4e59a7f5a8cd86d7b3abf8fe
2019-04-05 06:47:14 -07:00
Pascal Hartig
684ecd8a39 Don't retrieve info object twice
Summary: Some unnecessary syscalls in the way we actually use this at the moment.

Reviewed By: danielbuechele

Differential Revision: D14750875

fbshipit-source-id: 5959ed0845398b29698ab58f7359869fa3657fdc
2019-04-04 09:54:23 -07:00
Pritesh Nandgaonkar
2655d9b0ef Fix the reason getting truncated
Summary:
The reason was getting truncated, even though it had space to show the message. Look at the screenshot

BUG:

{F155254538}

Reviewed By: jknoxville

Differential Revision: D14775792

fbshipit-source-id: d18a458150c272c0c4e22cda9ea6459f96a70ea3
2019-04-04 08:17:38 -07:00
Pritesh Nandgaonkar
e19d6a723e Fix open log bug
Summary:
For the native crash, the crash log is logged as seperate messages. So crash reporter plugin merges them together and fires one notification. The merrging logic is timer based, so if multiple crash log message is posted in 50ms, it will be combined in one notification.

For the above case, the "Open in Logs" functionality was broken, as we used to compare the entire callstack in one entry rather than in the multiple rows. This diff fixes this issue.

Bug:

{F155167144}

Reviewed By: jknoxville

Differential Revision: D14748956

fbshipit-source-id: d24db6d47fa3cd633a9002ac77f37c267ca4924f
2019-04-04 04:39:48 -07:00
Pritesh Nandgaonkar
830c8067e4 Timeout promise while exporting flipper plugin
Summary:
Added a promiseTimeout util so that we limit the time taken to export flipper plugin. I had received a feedback from the user stating that that the loader for the export stays for ages and never finishes. So this diff adds a timeout to the promise which is returned by `exportPersistedState` function. This function is currently implemented just by Layout inspector to fetch the entire view hierarchy. I suspect the the former mentioned bug may be due to the unresponsive client.

This diff also shows the plugin and the client information for which `exportPersistedState` timed out. Also this will hopefully solve the problem surfaced recently stating that the bug report gets stuck, the reason for which I suspect would be the same as the above mentioned reason, because we export flipper data when we create a bug report.

Reviewed By: danielbuechele

Differential Revision: D14712633

fbshipit-source-id: 35f8cfa722ec3b7ff94ebda943d618834ac3207d
2019-04-04 04:20:15 -07:00
Pritesh Nandgaonkar
45999a5292 Share sheet for the file export
Summary:
This diff shows an export sheet when one exports the Flipper data in a file. It also shows if any error happens.
Look at the video in test case.

Reviewed By: danielbuechele

Differential Revision: D14624194

fbshipit-source-id: dea0179a83e626e49593e5dde1d5ff128048db02
2019-04-01 08:53:37 -07:00
JianyingLi
1e97d7683f iOS Devices are not yet supported Displayed only when iOS physical device is selected
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/400

Reviewed By: jknoxville

Differential Revision: D14663825

Pulled By: passy

fbshipit-source-id: 6942668e63bb98ef2e0fa299b4b7dcf9ca6af3c6
2019-03-28 08:36:13 -07:00
Pascal Hartig
b20d0a4c8b Add headless option to dump on disconnect
Summary:
This adds an optional exit strategy that reacts to the client disconnecting rather than a `SIGINT` which can be used for integration tests.

`MiddlewareAPI` is a subset of `Store` and required to work here.

Annoyingly, it's not quite clear to me why this does not work as part of an event loop cycle and requires a `setTimeout`. This doesn't have any negative effects and works in the same way that the SIGINT interruption works, but it's a bit of an eyesore.

Reviewed By: danielbuechele

Differential Revision: D14622111

fbshipit-source-id: e2caca056e478428d977565dc9bc09eefca4230c
2019-03-28 06:53:57 -07:00
John Knox
f6f00611d5 NativePlugins: Handle sidebar sections
Summary:
Adds ability to send sidebar sections from the mobile app.
Currently implemented sections are json blob, and toolbar (row of buttons).

Note that I have not tested the toolbar with more than one button. I'm currently implementing features as needed so this should be considered alpha support at the moment.

Reviewed By: passy

Differential Revision: D14642879

fbshipit-source-id: 84876935337741422242285dc48da79af3a1d5ee
2019-03-28 06:45:38 -07:00
JianyingLi
06e2379a78 Add contentType application/hal+json support
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/402

Differential Revision: D14663823

Pulled By: passy

fbshipit-source-id: 873a286f7d2e73c5cee4b9586adeadffa0292e43
2019-03-28 03:55:31 -07:00
Pritesh Nandgaonkar
153c75cfa9 Remove crashreporter GK
Summary: Remove the GK

Reviewed By: jknoxville

Differential Revision: D14596572

fbshipit-source-id: 09ef9359ce37c674ac7e1741b7d550716fca5156
2019-03-27 08:45:42 -07:00
Pritesh Nandgaonkar
9dbbae91d2 Provide the capability to copy crash name and reason
Summary: This diff allows user to copy crash name and crash reason in the clipboard

Reviewed By: jknoxville

Differential Revision: D14594212

fbshipit-source-id: 88a99af70e0e1aa5950e144a9072a8d96d7d3fc3
2019-03-27 08:45:42 -07:00
Pritesh Nandgaonkar
c422829beb Limit the message length in the notification
Summary:
Before this diff the notification fired for crash reporter had the entire callstack as its message, which is actually not required and it also makes a UI not good.

This diff just limits the message length

BUG:

{F154537911}

Reviewed By: passy

Differential Revision: D14594189

fbshipit-source-id: 663710e3e80be4367d0cc2a532fd4aa312cc0c1e
2019-03-27 08:45:41 -07:00
Daniel Büchele
880327b61d sign in
Reviewed By: passy

Differential Revision: D14598657

fbshipit-source-id: 3ee6ee5ec7323616ac200243747e0b44b1ce65d4
2019-03-27 04:21:23 -07:00
Daniel Büchele
1c904b219c copy Nuclide token
Summary:
* We are now using `flipper.oAuthToken` to store our token in the keychain
* If there is no Flipper token, we copy the Nuclide token (once)
* If the user signs out of Flipper, only the flipper token is removed from the keychain, not the nuclide token
* the Nuclide token is not copied anymore

Reviewed By: passy

Differential Revision: D14598658

fbshipit-source-id: ab0646b35575bd4b2e433d62bb98635f6d127fd2
2019-03-27 04:21:22 -07:00
Pritesh Nandgaonkar
dd3f0fdfeb Parse Date from the crash and fix the date mismatch in the UI
Summary:
This diff parses the `Date` from the crash log, so that the `Date` shown on the UI matches with the actual crash log
Bug:

{F154301489}

Added test too

Reviewed By: danielbuechele

Differential Revision: D14563053

fbshipit-source-id: b9dc7de11d7f17d6c7aa2afe5106b8f85c0a535c
2019-03-25 04:53:40 -07:00
Pritesh Nandgaonkar
0adc2ef52e Multiple crash support
Summary: This diff adds support to show multiple crashes in the crash reporter plugin. You can also select crashes from the list of the dropdown.

Reviewed By: danielbuechele

Differential Revision: D14513401

fbshipit-source-id: 621d32c5971519e5046daec76ec2f9b32ba4d8ce
2019-03-25 04:53:40 -07:00
Pascal Hartig
939cc531e2 Fix revision bundling
Summary:
This fixes headless not terminating due to the `package.json` not being readable.
I instead write this to the `global` object in the same way that the version is
set.

Reviewed By: jknoxville

Differential Revision: D14579316

fbshipit-source-id: 238afe912366c423552305e120088f4abac4c20b
2019-03-22 10:41:01 -07:00
John Knox
57a24769e8 JS side of Native Plugins
Summary:
Native plugins are plugins that can be written in mobile code alone (java/objc), provided they conform to a template, currently table is the only implemented template.

This adds support to flipper for handling them.

Reviewed By: danielbuechele

Differential Revision: D14502188

fbshipit-source-id: a96be9b06de1cecf7977c4ef2fd05b168f7f1330
2019-03-22 07:07:31 -07:00
John Knox
ba0cdf641d Fix error bar displaying
Summary: The error was getting wiped accidentally if register device didn't have any error. In practice, meaning that the "flipper already running" message only flickered on the screen and then disappeared.

Reviewed By: passy

Differential Revision: D14576768

fbshipit-source-id: 1c7443f8f25ffa6a56f8d4994f3fef53bbb02c6d
2019-03-22 06:52:05 -07:00
John Knox
bf9be74ad2 Remove RecurringError type
Summary:
This was originally introduced so we could squash multiple instances of the same error at the client side and only report one instance of them.
Now we've moved to doing the aggregation server side, which is more powerful, so this is no longer necessary. We've also seen a case of these Error objects appearing opaque making it hard to see the underlying problem, so removing it entirely.

Reviewed By: passy

Differential Revision: D14576715

fbshipit-source-id: b285dcb5249e209f9008a14ac6a2f226f3aa82d7
2019-03-22 06:52:05 -07:00
Pascal Hartig
daf8cfea2a Remove unneeded flow fixme
Summary: Per title.

Reviewed By: jknoxville

Differential Revision: D14561355

fbshipit-source-id: 45681a754ff91d90057d48ba9f567770a87bc3c6
2019-03-21 08:38:25 -07:00
Pritesh Nandgaonkar
5964f1621e Open source Import/Export feature to open source
Summary: Exposes Import/Export feature to open source. This diff also makes sure that, "Shareable Link" option doesn't show up, as it is specific to fb's infrastructure.

Reviewed By: passy

Differential Revision: D14526634

fbshipit-source-id: 3aeb97c91bc00a9c5f01c74c34a5690ec3b5739d
2019-03-20 06:59:28 -07:00