Commit Graph

1024 Commits

Author SHA1 Message Date
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
Pascal Hartig
3b18303560 Revert D13302768: [flipper] Upgrade to cmake 3.10.2
Differential Revision:
D13302768

Original commit changeset: c38601659bde

fbshipit-source-id: d624e51a489cd2d85288f85e13e09638e2ebb4be
2018-12-06 04:45:54 -08:00
Pascal Hartig
03b5306459 Upgrade to cmake 3.10.2
Summary: This was recommended by my Android Studio 3.3 when starting up, so let's do this.

Reviewed By: jknoxville

Differential Revision: D13302768

fbshipit-source-id: c38601659bde4515d62b31efbd907b44304aafba
2018-12-05 15:47:22 -08:00
Pascal Hartig
dfd2e279bc Update getPlugin docs
Summary: Per title.

Reviewed By: jknoxville

Differential Revision: D13304655

fbshipit-source-id: 8f9e78dbee043e749b1fdd2d4a540eeece66734b
2018-12-05 08:03:41 -08:00
Pascal Hartig
214f112c14 Add getPluginByClass interface
Summary:
This deprecates the `getPlugin(String)` method and introduces
a `getPluginByClass(Class<T>)` instead which avoids having
to `instanceof`-check and then cast the result, which provides
a nicer experience for Java users.

Reviewed By: jknoxville

Differential Revision: D13277568

fbshipit-source-id: fb7b5b8c0180470ef0ad322559b5b7424520848b
2018-12-05 08:03:41 -08:00
John Knox
606d689cae Don't do iOS-specific setup when not supported
Summary:
Now flipper will include iOS devices in the dropdown, but you'll also get a message saying they aren't yet supported.
Also doesn't start up the PortForwardingMacApp instances in this case, because it's pointless.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13319990

fbshipit-source-id: 75d72c6ed2478c7b999c5f43b764f097141b33de
2018-12-04 07:10:51 -08:00
John Knox
3057c0a6e7 Show indicator when client setup fails (#339)
Summary:
At the moment, when a client is failing to connect, you effectively get an infinite spinner, as it keeps retrying.

This keeps the spinner while it's retrying, but in between, shows a failure icon.

This isn't perfect. It's still shown under possibly the wrong device, but that already happens anyway, this just adds an extra icon.
Pull Request resolved: https://github.com/facebook/flipper/pull/339

Reviewed By: priteshrnandgaonkar

Differential Revision: D13319635

Pulled By: jknoxville

fbshipit-source-id: e16177ecc7058b779fb17b61e20fcbac8ccf0c29
2018-12-04 07:10:51 -08:00
John Knox
20ed54566d Reject empty CSRs
Summary: I'm not sure if this ever happens, but currently if an empty csr came in from a device, it could cause at the very least confusing errors, and worse incorrect setup state in devices, meaning they can't connect.

Reviewed By: passy

Differential Revision: D13302621

fbshipit-source-id: 80ff79d2eabd0988059c34bfa92587c82516997a
2018-12-04 05:59:16 -08:00
Pritesh Nandgaonkar
e84e859fc1 Limit the size of the containers and make it scrollable
Summary:
Improves the UI of crash reporter plugin

- Added max height on the value container with scrollable capabilities
- Fixed the bug in UI of the plugin where it showed the latest crash data even though one navigated to the plugin from old crash notification

Reviewed By: danielbuechele

Differential Revision: D13307302

fbshipit-source-id: 97eb96d3d9947a2835cd5572053256e0bdc01e27
2018-12-04 05:51:59 -08:00
Pritesh Nandgaonkar
9cfa1b3074 Send notifications on litho's error boundary
Summary: Sends notifications to crash reportr plugin whenever the error boundary happens

Reviewed By: danielbuechele

Differential Revision: D13307473

fbshipit-source-id: dc0c6d2ebac32881fdb1aa5f63def824a115cf9e
2018-12-04 05:51:59 -08:00
Daniel Büchele
d331ec2f10 adding Android ReactPlugin
Summary:
Adding a a react-devtools plugin for Android.
This doesn't do much, but announces the plugin to be available.
To make this work on remote device, the hostname and port sent to the device needs to be set in the dev tools. This is isn't done yet, so this will only work for simulators.

Reviewed By: jknoxville

Differential Revision: D12897151

fbshipit-source-id: b874549925c395ff6356f6745b9706b182d544dd
2018-12-04 03:37:47 -08:00
Daniel Büchele
5a9d92c786 upgrading react-dev-tools
Summary:
Updating react-devtools plugin to the latest version.

As Flipper doesn't use a websocket anymore, this plugin was not working. In this diff, we are creating a websocket connection parallel to the rSocket connection which is used by the devtools. First we thought about tunneling the websocket through our rSocket, but this would be a lot more work.

By default they create a web-socket running on port 8097. But if this port is in use another port is used. The hostname and port to connect to is sent to the client-plugin.

Reviewed By: jknoxville

Differential Revision: D12897150

fbshipit-source-id: 6652b3c91fd5bd87fe86b29c730c8b2076bbc6ba
2018-12-04 03:37:47 -08:00
John Knox
a656c31a70 Clean up connection test
Summary: Replace the console.error and lack of calling done(), with an explicit expect() call to make failure results clearer.

Reviewed By: danielbuechele

Differential Revision: D13254777

fbshipit-source-id: 602081323ad3cc1432ddb706f49f036f0fb8926d
2018-12-04 03:27:54 -08:00
John Knox
40f50d48e3 Add physical iOS support to internal build
Summary: Adds support for physical iOS devices, when the necessary dependencies are present. Unfortunately these aren't open sourced yet so the open source build won't get this feature yet.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13001473

fbshipit-source-id: d8c2bcd53b7972bec676717c8af0112800b918d0
2018-12-03 11:34:53 -08:00
John Knox
8d93946739 Add FBPortForwarding source code
Summary:
See FBPortForwarding/README.md for an explanation of what this is.
It's required for the upcoming support for physical iOS devices.

To simplify development of the JS app, We're going to bundle the pre-built PortForwardingMacApp
inside the repo, and inside the electron app (static/PortForwardingMacApp.app).
Adding this source so users can build it from source if they choose to.

Reviewed By: danielbuechele

Differential Revision: D13276022

fbshipit-source-id: 99b18e0412cf443bb4a67eb4846cc780e0014de1
2018-12-03 11:34:53 -08:00
Daniel Büchele
98110bc230 update wording for dynamic plugin loading
Summary: as per title

Reviewed By: passy

Differential Revision: D13301525

fbshipit-source-id: 693d067895f6600ce041a9ced445c763bc0a90a1
2018-12-03 10:59:37 -08:00
Pritesh Nandgaonkar
06588b3d1f Adds crashreporter plugin to fb4a
Summary: Adds crashreporter plugin to fb4a

Reviewed By: jknoxville

Differential Revision: D13278471

fbshipit-source-id: 1baa7520b2806bebdc960077bfda0699b290109b
2018-12-03 05:27:28 -08:00
Daniel Abramowitz
0f5cee4fec Reenable SubDescriptors after fixing a bug on the flipper client dealing with empty strings
Summary: Previously an empty string would crash the flipper client. Now that we handled that ok, we can reenable the descriptors.

Reviewed By: jknoxville

Differential Revision: D13257534

fbshipit-source-id: 09be4834d5a7023b2fa4e2bee7e57e412916120b
2018-11-30 10:50:32 -08:00
Daniel Büchele
133788380e prevent unnecessary rerenders
Summary:
Updates of the redux store caused rerendering of UI components, even without the acutal UI changing. This diff ensures the UI is only updated, when

The PluginContainer received all plugin states and selected the pluginState of the active plugin to pass it down to the plugin. However, this caused a rerender everytime a pluginState changed (even if the plugin was in the background).

This diff moves the selection of the active plugin to the `connect`-function and only passes the state of the active plugin into the container. This makes sure the plugin rerenders only if it's own state changes.

The main sidebar displays the number of notifications. Therefore, it was passed the array of notifications. However, this array is regenerated, everytime a new notification **might** be triggered.

Now, the number of notifications is calculated in the `connect`-method and only the number itself is passed into the component. This makes sure the sidebar is only rerendered, when the actual number of notifications changes.

Reviewed By: passy

Differential Revision: D13276096

fbshipit-source-id: bf1e6c4a186f7a1cf7f7427cd3523b5b71eb003a
2018-11-30 09:39:28 -08:00
Daniel Büchele
34e75c3c5f GK failing log message
Summary: When a plugin has no gatekeeper defined, an incorrect warning was logged, saying that if fails the gatekeeper "undeinfed"

Reviewed By: jknoxville

Differential Revision: D13275803

fbshipit-source-id: 9ae5ed55031cc6a636c7c5ffa23bdd059a8ed35f
2018-11-30 09:39:28 -08:00
Pritesh Nandgaonkar
3183e56560 Add crash reporter plugin to wilde with a gatekeeper
Summary: Adds crash reporter plugin in wilde under a gatekeeper `flipper_crash_reporter_plugin`. By default all the employees will be part of this gatekeeper

Reviewed By: passy

Differential Revision: D13258265

fbshipit-source-id: 1baa2a342f492781d8fb3e86c2a30140537c23f1
2018-11-30 07:19:46 -08:00
John Knox
28e2190635 Improve "Connect to desktop" diagnostic step
Summary:
This does two things:
1. Change "Connect to desktop" to say which connection it's establishing instead, which makes it clearer what's actually happening. This step really does mean establishing a connection, because what happens during that connection is asynchronous after this step completes.
2. Call step->complete() after certificate exchange connection is established. This wasn't happening before, so you'd always get "[Failed] Connect to desktop" even after a successful cert exchange.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13256783

fbshipit-source-id: 5e8e3a54f52d2e0adbde4c6d82d1acc840f1eb59
2018-11-30 07:04:10 -08:00
John Knox
f15fe48fa9 Clean on-device sonar dir between certificate exchanges
Summary:
During certificate exchange, the mobile device creates a public/private key pair, and then requests a certificate from flipper to match it's public key.

Flipper responds with the cert and it's written to the sonar dir along side the key pair files.

If certificate exchange happens again for any reason, the mobile device will regenerate the key pair and request a new cert. If for any reason that cert never arrives, then the device is in a state where it has the new key pair, but the old certificate that doesn't match its new credentials. This would never work, but it means you get a strange SSL error because you're using inconsistent files.

To improve error messaging, I'm making the client wipe all files before starting the certificate exchange step, so you should never get key/cert mismatches. Now the device can tell it doesn't have all the necessary files and won't even attempt to connect until it does.

Reviewed By: passy

Differential Revision: D13256369

fbshipit-source-id: 28f3cb5ba5938c17f01294683ba86c418f651376
2018-11-30 06:23:40 -08:00
Pritesh Nandgaonkar
fd022e3c73 Improvise UI of crash reporter plugin
Summary:
- New improved UI
- Instead of sending the callstack as a string from android, now sending it as an array
- Deeplink to Logs support just for android. In iOS crash is not automatically logged in Logs plugin, atleast thats what happens in sample app

Reviewed By: jknoxville

Differential Revision: D13216477

fbshipit-source-id: d8b77549c83572d0442e431ce88a8f01f42c9565
2018-11-30 05:28:46 -08:00
Pritesh Nandgaonkar
d37fa7ba95 Change crash reporter plugin to send callstack array
Summary: Change crash reporter plugin to send callstackas an array instead of string

Reviewed By: jknoxville

Differential Revision: D13254853

fbshipit-source-id: 0baefb3eb6d3afc38d0c6acc7840ddc981230f9d
2018-11-29 09:15:40 -08:00