Commit Graph

848 Commits

Author SHA1 Message Date
Pritesh Nandgaonkar
da37ab78bd Docs with an updated install instruction (#343)
Summary:
This PR updates the installation instruction. It missed few crucial information and thus the projects installing flipper as a dependency were facing issues. It addresses the issue #341. It also brings the sample application at par with the documentation.
Pull Request resolved: https://github.com/facebook/flipper/pull/343

Reviewed By: danielbuechele

Differential Revision: D13507298

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 5a4b23d79930cb7eeb491e359b616d3558e260fb
2018-12-21 07:40:57 -08:00
Pritesh Nandgaonkar
470c770e97 Back out "[flipper] Explicitly start adb server"
Summary:
Original commit changeset: b1eae542aaa6

 This D13487864 has broken `adb start-server` command for the production builds, thus this diff backs out the changes done by that diff.

Reviewed By: danielbuechele

Differential Revision: D13532003

fbshipit-source-id: 1d169dcdab11a52f075187803219915f444952d6
2018-12-21 07:24:27 -08:00
Pritesh Nandgaonkar
9d4bb45dbc Refactor CrashReporter plugin
Summary: This diff refactors CrashReporter Plugin. The business logic of crash reporter plugin was placed in the `iOSDevice.js` as it gets the hook to the initialisation of iOSDevice. This diff moves the business logic to the Crash Reporter plugin files under the plugins folder. To get the hook, so that we can add our watcher, I have added a static function over `FlipperBasePlugin`, which if exists, will be called once `REGISTER_PLUGIN` event is dispatched

Reviewed By: danielbuechele

Differential Revision: D13529035

fbshipit-source-id: 28216b273b4032727859107d8a6751c6465af9ac
2018-12-21 07:03:21 -08:00
Daniel Büchele
780ac863b8 Adding PluginDebugger sheet
Summary: Adding a PluginDebugger that gives the user some information why a plugin might not be loaded.

Reviewed By: jknoxville

Differential Revision: D13465143

fbshipit-source-id: f5d7037850874ca9545ac1523fb4e0f18ede7273
2018-12-20 06:14:35 -08:00
Daniel Büchele
fa9b85b065 showing multiple sheets
Summary:
The sheet was only used for the bug-reporter before and we had an explicit boolean flag in the redux store to keep track if the bug reporter is shown.

Changing this it an `activeSheet` property, which allows us to show arbitrary sheets, while making sure to only show one at a time.

Reviewed By: jknoxville

Differential Revision: D13516985

fbshipit-source-id: 3e83f719e2b61d0b2229268ebfdc910123b403d2
2018-12-20 06:14:35 -08:00
Daniel Büchele
6827515329 storing information about failed plugins
Summary:
If a plugin was not loaded we used to ignore it. This diff still ignores the plugins that weren't loaded, but adds some information about them to the redux store. This information is used in the PluginDebugger.

These are the three reasons, why a plugin might not be loaded.

* `gatekeepedPlugins`: Plugin was ignored because of a GK
* `failedPlugins`: Plugin could not be requried/failed to parse
* `disabledPlugins`: Plugin disabled in `~/.flipper/config.json`

Information for each them is added to the redux store.

Reviewed By: passy

Differential Revision: D13516986

fbshipit-source-id: b7a55a159cb586d1a88fbb976248131c52a909c5
2018-12-20 06:14:35 -08:00
Pritesh Nandgaonkar
9ec04d33e2 Back out "Revert D13434177: [Docs] Updated the website docs with the information of crash reporter plugin"
Summary:
Original commit changeset: 36e501b0ca70

The original diff was reverted because the sheriff thought that my diff broke the flipper test but it was not the case.Thus putting it back

Reviewed By: passy

Differential Revision: D13495123

fbshipit-source-id: 7e72dafe967236b968baf9d4741b3673f46a27cb
2018-12-20 06:05:25 -08:00
Pritesh Nandgaonkar
9748aba878 show crash notifications only for a particular device
Summary:
Before this diff we used to show crash notifications for all kind of crashes. This diff adds the check, which makes sure that only the crashes of a selected device is shown

Also added tests and updated few tests

Reviewed By: danielbuechele

Differential Revision: D13518019

fbshipit-source-id: 6d640d078a43480274242a5d86f2d135d875d630
2018-12-20 05:21:37 -08:00
Daniel Abramowitz
bb7c8a152a Generic layout inspector section
Summary: `PropWithNamedFlipperObject` is an interface that can be implemented by a Litho component prop to display a new section in the Flipper layout inspector.

Reviewed By: danielbuechele

Differential Revision: D13419918

fbshipit-source-id: be2ade160d6381944b1b68a7645b5b23f1d142a1
2018-12-19 09:43:31 -08:00
Daniel Büchele
20e636865c generic Sheet component
Summary: this moves the `Sheet` into its own component, so it can be reused for other places than the bug reporter.

Reviewed By: passy

Differential Revision: D13468275

fbshipit-source-id: 5f6d07a54dda078bd08a4c4cd31a41c61b58a76f
2018-12-19 09:06:44 -08:00
Pritesh Nandgaonkar
ade6eabdb0 Fix the regressed deeplink support for crash reporter plugin
Summary: The deeplink from crash notification to crash reporter plugin was broken. It always showed the latest crash.With this diff the crashreporter plugin shows the correct crash information.

Reviewed By: danielbuechele

Differential Revision: D13487792

fbshipit-source-id: eee6826bb0a84d0aab9b432a1c9a04aa7d528402
2018-12-19 07:01:09 -08:00
Pritesh Nandgaonkar
3135c99cc5 Fix crash reporter plugin test
Summary: The test were broken, as the `CrashReporterPlugin.id` was empty. This value is populated when plugin is loaded, thus added a helper function for that. Also removed a duplicate test.

Reviewed By: danielbuechele

Differential Revision: D13517063

fbshipit-source-id: ffb99316933cd27068c6bce67cfa6e95633b6246
2018-12-19 06:33:29 -08:00
Daniel Büchele
ea54b6d4ca adding docs for new package.json fields
Summary: as per title

Reviewed By: priteshrnandgaonkar

Differential Revision: D13432418

fbshipit-source-id: fd96d7ea54127d1256f3c0b147e19338be8e7b72
2018-12-18 16:28:08 -08:00
Pritesh Nandgaonkar
2c9feb40e9 Remove crashreporter plugin iOS implementation
Summary: Removes the iOS implementation of crash reporter plugin as its implemented as desktop plugin

Reviewed By: adamjernst

Differential Revision: D13451980

fbshipit-source-id: 19cca52a00bb4a6d350eff91ac405f6dd3b07818
2018-12-18 13:42:40 -08:00
Pritesh Nandgaonkar
a12768539e Crashreporter plugin by adding a watchman for crash log
Summary:
This diff adds a watcher on `~/Library/Logs/Diagnostics/` library and fires a notification whenever a crash log is added there. This will only work for iOS crashes. With this change, for iOS we should be able to see all kind of crash notification be it due to uncaught exception or a native crash or signal errors.

For android, it will still show notifications due to uncaught exceptions. In upcoming diffs, I will change the logic for android too by parsing Logcat logs.

This diff doesn't support physical device crash reporting. The crashes for physical devices are synced to other folder and that too they are symbolicated.

Reviewed By: danielbuechele

Differential Revision: D13404648

fbshipit-source-id: 7219855ebc73451af87f77f90cc3ed0f2ab5287c
2018-12-18 13:42:40 -08:00
Pritesh Nandgaonkar
e3fb1e1d84 Disable crash reporter plugin for iOS and update callstack from array to string
Summary:
This diff does the following

- Comments out the code in iOS which sends the message to the desktop side
- Also comments out the part where signal handler is initialised, as we no longer need it. I will remove the iOS implementation completely in next few diffs
- Updated the JS side to expect call stack as a string instead of an array
- Updated the android side to send callstack as a string

I have commented out the code for crash reporter plugin of iOS as for iOS I will be adding a watchman  to a directory where crash logs are dumped. The diff related to this is in the stack

Reviewed By: passy

Differential Revision: D13424824

fbshipit-source-id: b1105da912292bf73cff948206c031de9b059abd
2018-12-18 13:42:40 -08:00
John Knox
73e921bafc Disable iOS portforwarder
Summary:
Disabling the port fordwarder.
On physical devices, when flipper isn't running and they don't have any certificates, they attempt to connect to the desktop.
They always connect to the portforwarder, even though it doesn't connect to flipper desktop.
After connecting to the portforwarder, they then try to generate the SSL certs. This is a CPU intensive operation and happens repeatedly in this condition when it really shouldn't be, causing high cpu usage.

Disabling for now. The fix will be to make sure that they only do that generation when they are fully connected.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13507353

fbshipit-source-id: a858a5da7352228b063150334ea443130763d888
2018-12-18 13:42:40 -08:00
Daniel Büchele
1fc73ad2fb update plugin's package.json
Summary:
For all plugins:
- move static fields `title`, `id` and `icon` to `package.json`
- adds "bugs" field for all plugins containing links to support groups/oncalls.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13417286

fbshipit-source-id: 7b341176915f3ed7b473b95c1d879f21d7d634ef
2018-12-18 10:36:35 -08:00
Daniel Büchele
c9b982b182 revamp UI + show oncall/group
Summary:
Redesigns the bug reporting dialog:
- show information from `package.json`'s `bugs` field, where we can link to support groups or name oncalls.
- adds show/hide animation
- uses new button style

Reviewed By: jknoxville

Differential Revision: D13417287

fbshipit-source-id: 2948794e9b1f42bbd895981d5e4b0578a9b8ee2e
2018-12-18 09:34:52 -08:00
Daniel Büchele
c540fe5529 adding primary and compact buttons
Summary: Adding a style for `primary` buttons

Reviewed By: priteshrnandgaonkar

Differential Revision: D13417284

fbshipit-source-id: 8ef46092d79ee0f9d39167aa2662a84caca9aa11
2018-12-18 08:37:28 -08:00
Daniel Büchele
6ffc027051 read infos from package.json
Summary:
Adding the properties from a plugin's `package.json` as static properties to the class.
The name from `package.json` is used as it's `id`.

This allows us in the future to add meta information about a plugin to it's package.json and still use the data inside the app.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13417288

fbshipit-source-id: 3d0a62d4cb0115153cce1aaee677b9680fefebf4
2018-12-18 08:37:28 -08:00
John Knox
e23da69db9 Use localhost instead of hardcoded IP address
Summary:
We can only do this when adb reverse is available, i.e. on Android 5+.
This also relies on a recent change to flipper desktop, to always run adb reverse on emulators.

Reviewed By: danielbuechele

Differential Revision: D10302579

fbshipit-source-id: cff07f0311d413fdd49424a42c641dfb3d225f7c
2018-12-18 07:31:43 -08:00
Pascal Hartig
ee0b640c30 Fire-and-forget for openFile
Summary:
`xdg-open` is blocking on Linux. That means we won't do our cleanup steps
(or reset the button for that matter) until the user closes their viewer app.

This changes the call to be a `spawn`, so we can continue the chain. As no
one had actually used the value captured in the promise, this shouldn't
make a difference API-wise.

Reviewed By: danielbuechele

Differential Revision: D13465571

fbshipit-source-id: 5f698916157906d76ab983109deb9abe142baa9e
2018-12-18 03:18:21 -08:00
Pascal Hartig
4cb82c1f1d Avoid media indexing on Android
Summary:
Record Android screen captures into a separate directory with a `.nomedia`
file to avoid it from getting indexed before it gets removed after being
pulled.

Reviewed By: danielbuechele

Differential Revision: D13465448

fbshipit-source-id: 4449ff3a927cc8621b015b018d2b743cedc4ce8c
2018-12-18 03:18:21 -08:00
Qichuan
d7ecd3af5a Fixe the iOS UserDefaultsPlugin (#340)
Summary:
The `getAllSharedPreferences` API is not implemented in the iOS UserDefaultsPlugin and thus the data is not shown in the `Shared Preference Viewer`.

This PR implements the missing API and present the Standard UserDefaults data from the target application.
Pull Request resolved: https://github.com/facebook/flipper/pull/340

Reviewed By: danielbuechele

Differential Revision: D13464765

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 8c6cf4e9f7094fcf75c71cce43cb6c34f9f957e7
2018-12-17 11:08:29 -08:00
John Knox
cc5fba6975 Explicitly start adb server
Summary: We were relying on adbkit to do this, implicitly by calling listDevices(). However, this doesn't appear to be reliable, with retries, it usually succeeds, but sometimes still doesn't. I'm aiming to avoid all this entirely by just starting it directly using adb itself, which I expect to be much more reliable.

Reviewed By: danielbuechele

Differential Revision: D13487864

fbshipit-source-id: b1eae542aaa6ecb2b74b575a3582934093ccd588
2018-12-17 11:08:29 -08:00
Mike Kelley
a1541b1c81 Revert D13434177: [Docs] Updated the website docs with the information of crash reporter plugin
Differential Revision:
D13434177

Original commit changeset: bb8b14e989c9

fbshipit-source-id: 36e501b0ca7031956b57c93429084a7bc673ef77
2018-12-17 11:08:29 -08:00
Pritesh Nandgaonkar
1bc566f813 Updated the website docs with the information of crash reporter plugin
Summary: Added the documentation of crash reporter plugin. Also removed the stale comment

Reviewed By: passy

Differential Revision: D13434177

fbshipit-source-id: bb8b14e989c91b35cd268daea12ac7fe590c5d5b
2018-12-17 11:08:28 -08:00
Daniel Büchele
88820d4865 add D3 fork
Summary:
`react-d3-tree` is using version `3.5.17` of `d3`. However, this version of D3.js makes some assumptions about the context, which are not compatible with the way metro is bundling our plugins.

In this version of D3, they reference the `window` by using `this`. However, in metro a top level `this` is `undefined`. This causes the library to break. New versions of D3 have removed referencing the `window` using `this`. Updating `react-d3-tree` to a more recent version of D3 is not easy, because there are many breaking changes in D3 (the current version of D3 is 5.x).

This is why we decided to fix the callsites in `d3@3.5.17`. As these thinks are fixed in `d3@4.x` as well, it doesn't make sense to bring these changes upstream. For this reason, we are committing the fixed version of D3 and use yarn resolutions to resolve D3 with the version including our fixes.

These things were patched in `d3.js`:

- adding `/* eslint-disable */`
- replacing `this.document` with `window.document`
- replacing `this.navigator` with `window.navigator`
- replacing `this.requestAnimationFrame` with `window.requestAnimationFrame`

Reviewed By: priteshrnandgaonkar

Differential Revision: D13377064

fbshipit-source-id: 492eaad4f283fb6901cab089f6092b0bf62d5499
2018-12-14 10:35:12 -08:00
Daniel Büchele
c92efdf945 add JS plugin
Summary:
Adding the JS part for the ComponentTree plugin.
Native parts are added in D13377058.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13377066

fbshipit-source-id: dab8f2abdde604c3f78cfd80e17b433ef5e33505
2018-12-14 10:35:12 -08:00
Daniel Büchele
29f6e2ed4f hideHeader
Summary: The `hideHeader` didn't hide the header. Fixed it!

Reviewed By: priteshrnandgaonkar

Differential Revision: D13377067

fbshipit-source-id: 105541169d46b6db1a85e99c8d93ee52f904d261
2018-12-14 10:35:12 -08:00
Daniel Büchele
0143052f98 StackTrace
Summary: Adding a UI component for displaying StrackTraces

Reviewed By: priteshrnandgaonkar

Differential Revision: D13377068

fbshipit-source-id: 7119bad3d413ad7c5eafd09aa04e741a1b200b7b
2018-12-14 10:35:12 -08:00
Daniel Büchele
3b45976217 MarkerTimeline
Summary: Moving the `MarkerTimeline` from the QPL plugin to the Flipper UI library, so it can be used by other plugin.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13377065

fbshipit-source-id: 9ef1f0e044fa85b68a01e23071042600aa5c3c63
2018-12-14 10:35:12 -08:00
Pascal Hartig
c9131963d5 Remove debug log
Summary: Leftover from logs refactoring I suppose. Missed it in review too. :D

Reviewed By: danielbuechele

Differential Revision: D13465385

fbshipit-source-id: 42508e8981f12ca43f4b56a6ecc2e53078f49c1a
2018-12-14 07:22:23 -08:00
Pascal Hartig
7e847a62f5 Add bintray verification script
Summary:
Copied over form Litho, but works in our repo too.
This can be used to verify that a given version number
is properly accessible via maven. Just used this to check
if `v0.13.0` was available and sadly it wasn't because
Travis was broken. Working on that now.

Reviewed By: danielbuechele

Differential Revision: D13449948

fbshipit-source-id: 7f113d971dac341938615e6352b5981f557ffecd
2018-12-13 05:33:37 -08:00
Pascal Hartig
f5e5c33c68 Flipper Release: v0.13.0
Summary:
- Crash reporter plugin: Get notified for crashes in Android and iOS apps. Currently in Alpha and not enabled by default.
- Support for physical iOS devices.

- `yarn start` in open source works again (54d09aa951)
- Prevent unnecessary UI rerenders (133788380e)
- Fixes a problem on macOS where external plugin from `pluginPaths` config weren't loaded  (f7ddf3b496)
- Various improvements for certificate exchange and device connections.

Full changes here: 19485d076b...c6e0517640

Reviewed By: danielbuechele, priteshrnandgaonkar

Differential Revision: D13431074

fbshipit-source-id: ef2087742911e4c5ee98af1941bc7db5cfe75578
2018-12-12 07:28:56 -08:00
George Zahariev
c6e0517640 Enable Flow Strict Local for 13 files in xplat/sonar
Summary:
First add a Flow Strict config, then enable Flow Strict Local for 13 files in xplat/sonar.

each change can land seperately:
drop-conflicts

Reviewed By: passy

Differential Revision: D13368791

fbshipit-source-id: 5bc1f9d3a179f4b9a554cc8cc629db0fda468a36
2018-12-11 13:49:14 -08:00
Daniel Büchele
b0cacc1272 scrollToHighlightedRows
Summary:
Moving the scrolling to highlightedRows from `componentWillReceiveProps` to `componentDidUpdate` to make sure the rows are rendered, when this method is called.

The method is called, whenever the highlighted rows change, and on the first update. The reason why this is called on the first update is described in an inline comment.

Reviewed By: passy

Differential Revision: D13376566

fbshipit-source-id: 311a1f430e08fcfb4e31b39a2c5b34910694917f
2018-12-11 07:57:59 -08:00
Daniel Büchele
fd1a00f05e linking to logs plugin
Summary: changing the payload to work with the updated logs plugin

Reviewed By: passy

Differential Revision: D13376392

fbshipit-source-id: ccfb1b1a7a2ec3e9d3899e70c9bdd199a489da88
2018-12-11 07:57:59 -08:00
Daniel Büchele
cbfbd0dd98 add test coverage for log processing
Summary: as per title

Reviewed By: passy

Differential Revision: D13376522

fbshipit-source-id: 4746d3234a13abdf81a23387e57d877714c94b44
2018-12-11 07:57:58 -08:00
Daniel Büchele
4546e64509 refactor logs processing
Summary:
The log plugin subscribed to the device logs, when it was mounted. Then, the device replayed all log messages that happened in before the plugin became active. While this works, this was not the most performant way to handle this, because it caused multiple rerenders.

In this diff, a method is added to `BaseDevice` to get all buffered logs. This method is called once the logs plugin becomes active. The processing of the logs is split into a couple smaller functions.

Reviewed By: jknoxville

Differential Revision: D13376393

fbshipit-source-id: bb151659c3335e10f647ae2dbf66e93b32d22913
2018-12-11 07:57:58 -08:00
Daniel Büchele
64b5e66168 upgrade react-window@1.3.1
Summary: as per title. The updated doesn't have any breaking changes. Only improvements and bugfixes.

Reviewed By: jknoxville

Differential Revision: D13376391

fbshipit-source-id: 46f2462cec87600f06fb793a42092f054489c397
2018-12-11 07:57:58 -08:00
Daniel Büchele
a993b630c8 fixing calles to undefined
Summary:
* using `includes` instead of `indexOf` for performance improvements
* fixing bug in Searchable overwriting `defaultFilter` variable
* adding default name for markers without name

Reviewed By: priteshrnandgaonkar

Differential Revision: D13397936

fbshipit-source-id: ee514dab7c2ac4acdaba86ccd41e0ef69815faeb
2018-12-10 08:32:58 -08:00
John Knox
140f846797 Track device register and unregister
Summary:
Now we get one event for every time an android or iOS device is detected by flipper.
This is different from a successfull connection. E.g. it may not have any flipper-enabled apps running.

Reviewed By: danielbuechele

Differential Revision: D13377316

fbshipit-source-id: 80e42ab0ae1c2ab50d4bec732a0fa86fcd941991
2018-12-10 02:21:33 -08:00
Daniel Büchele
f7ddf3b496 Add empty .watchmanconfig
Summary: An empty .watchmanconfig is required inside the application resources for the plugin loading to work. This diffs adds the file to the `static` folder, which is copied to the application ressources.

Reviewed By: jknoxville

Differential Revision: D13376834

fbshipit-source-id: 1b34a89c5be6f938a640c79ddb3e9ea784bd2d22
2018-12-07 08:06:07 -08:00
Pritesh Nandgaonkar
940ab5843f Add crash reporter plugin in swift sample app
Summary: Adds crash reporter plugin to swift sample app

Reviewed By: jknoxville

Differential Revision: D13359298

fbshipit-source-id: 2025725a7405d79407fbc15448d4f222f33c00fc
2018-12-07 07:37:55 -08:00
Pritesh Nandgaonkar
5894ad3834 Catch signal errors
Summary: This PR adds support to catch and report signal errors to the flipper. It also reports the callstack. Please look at the video in the test plan to understand the what it does.

Reviewed By: jknoxville

Differential Revision: D13328818

fbshipit-source-id: 304a68f47bb5ca5b0014c8b7d30f6a6fc2b6d147
2018-12-07 07:37:55 -08:00
Pascal Hartig
7eb1546f25 Move version specifier
Summary: Android Studio keeps loudly complaining about this.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13376394

fbshipit-source-id: 6163977bb013dff214aa684662e4879a19a7a786
2018-12-07 06:50:47 -08:00
John Knox
dc313a460c Don't invalidate connection files on Network Errors
Summary:
On iOS devices (internal only right now), when flipper desktop isn't running we get a Network Error instead of a Port not open error, because we can always connect to the port forwarding server running on the phone.
So in this case, don't count this error as a failure so we don't needlessly delete the certificates to attempt to fix it.

Reviewed By: passy

Differential Revision: D13358147

fbshipit-source-id: 8f9fb62cd2dcada058d104ef60f788a1b62d7094
2018-12-06 06:53:22 -08:00
John Knox
ee23119f24 Throw error if more than one device has same csr in container
Summary:
Getting more visibility on this.

We're seeing cases where the wrong deviceId is getting stored in the device connection_config.json.

This comes from flipper desktop in the response of 'signCertificate', and is figured out using getTargetDeviceId.

If we ever see these logs then something is wrong, and seeing the csr should help.

Reviewed By: passy

Differential Revision: D13357882

fbshipit-source-id: eb6befe07e7f9e7606e8940a1fed619351946d37
2018-12-06 05:37:11 -08:00