Commit Graph

1853 Commits

Author SHA1 Message Date
suyimo
eb4de1f3b7 Add protect when save task (#466)
Summary:
Bugfix

Add protect when save task

If local cache resource are valid, we don't create a Task .So here are crash.
Pull Request resolved: https://github.com/facebook/flipper/pull/466

Reviewed By: passy

Differential Revision: D15851816

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 753b3c5c9a6ed4c703c934a89e45fa30df99068c
2019-06-18 03:56:56 -07:00
Pascal Hartig
977a304672 Fix sidebar display
Summary:
Before:

{F162109040}

Reviewed By: danielbuechele

Differential Revision: D15855444

fbshipit-source-id: c95ab1b0aa577dec5d493a0f6d166cb3aeeb7419
2019-06-18 03:14:14 -07:00
Pascal Hartig
098d0bdba3 Increase z-index
Summary:
Ensure that sheets aren't underneath the headers in the images plugin.

{F162094893}

Reviewed By: jknoxville

Differential Revision: D15853171

fbshipit-source-id: 8fd7217a50ee2823a89b788718fdef50830dc31a
2019-06-18 03:14:14 -07:00
Pascal Hartig
9c75ea7665 Refactor share sheet selection
Summary:
We're if-ing over an enum, so this should be a switch.
Also removed the edge case for the share sheet and
made the error handling part of the component so the
user actually sees it.

Reviewed By: jknoxville

Differential Revision: D15853056

fbshipit-source-id: 241ed0f2e042b08c4c157db9616175297b683ac3
2019-06-18 03:14:14 -07:00
Daniel Büchele
5aaf0c4f29 debounce search
Summary:
Debouncing search to prevent triggering multiple searches, while typing.
Now, a search is only triggered, when the input hasn't changed for more than 200ms.
This affects all SearchableTables.

Reviewed By: passy

Differential Revision: D15855343

fbshipit-source-id: 261cf601249ac604c865ae10deb25d5c836f964a
2019-06-17 10:02:37 -07:00
John Knox
ee3473c42a Show timestamp in logs by default
Summary:
Makes the timestamp column visible by default in the logs plugin.
Can still be hidden by right clicking the column name.

Reviewed By: passy

Differential Revision: D15855890

fbshipit-source-id: 349a224c6a0ddfe607e7d92ce11df07c42b5db36
2019-06-17 09:58:05 -07:00
John Knox
1d776f6b9e Add copy with columns header option to table rows
Summary: Add "With columns header" and "Without columns header" options when copying rows.

Reviewed By: danielbuechele

Differential Revision: D15854176

fbshipit-source-id: ff7b5639cc313b74528e5e85f6c84e314058e899
2019-06-17 09:29:37 -07:00
John Knox
ef1eb41dba Use mutex library instead of repeatedly chaining promises
Summary:
I noticed that after a long-running flipper session, 11% of the memory was composed of millions of tiny PromiseReaction records (https://github.com/domenic/promises-unwrapping#promisereaction-records).

It seems this method of chaining promises meant that it was forming a linked list of these from the most recent, back to the very first invocation.

Instead of using a home-rolled lock, I'm replacing it with an actual library. Haven't verified the fix, but this seems like a better approach regardless.

Reviewed By: passy

Differential Revision: D15853570

fbshipit-source-id: 1626d9f25cba809794b13ee920bdec2cd1d4b874
2019-06-17 09:11:50 -07:00
Pritesh Nandgaonkar
347487a328 Fix fresco tests
Summary:
The test used to exit before the promise was fulfilled, so essentially all tests passed. For more details, read [here](https://jestjs.io/docs/en/asynchronous.html)

> Be sure to return the assertion—if you omit this return statement, your test will complete before the promise returned from fetchData is resolved and then() has a chance to execute the callback.

Reviewed By: jknoxville

Differential Revision: D15804017

fbshipit-source-id: 769caa8957737b4864c5888d28854920e6a1447a
2019-06-17 06:18:45 -07:00
Pritesh Nandgaonkar
e5294d34f0 Plugin name list
Summary:
Adds an argument to the headless Flipper to print the list of available plugins. Added `--list-plugins`.

Currently the startFlipper function is not scalable enough to add new arguments and its implementation. I am planning to tackle this with the list of Actions which will be closure. So adding a new argument with its implementation will be just appending a closure at the correct location in an array. Will work on that in the later diff stacked on the current one.

Reviewed By: jknoxville

Differential Revision: D15789778

fbshipit-source-id: 91ba472617d593c3490bb932590a06d83597cba7
2019-06-17 06:18:45 -07:00
Andres Suarez
198841d1d7 Rename uses of install-node-modules.sh in fbsource
Differential Revision: D15848788

fbshipit-source-id: b98626083ed7aee108f27d6e8c5c7b637e1b2327
2019-06-17 06:07:19 -07:00
Pascal Hartig
66c52930f2 Force newer underscore.string version
Summary:
To fix security alert from GitHub:

https://github.com/facebook/flipper/network/alert/website/yarn.lock/underscore.string/open

Reviewed By: jknoxville

Differential Revision: D15851515

fbshipit-source-id: ce9ca1543f9315c38c73b92fd84b8376283eb7bb
2019-06-17 04:47:23 -07:00
Arthur Kushka
1444946afa Added retries information to Insights tab of Networking plugin
Summary:
In React VR we doing automatic retries in cases when request takes too much time. It helps in cases when network quality is poor. As long as this implicit for developer, we would like to highlight this information in insights. It helps to explain why request were so long.

This diff adds one more field to insights which displays amount of time spent on retries, count and limit of them.

https://pxl.cl/CntV

Reviewed By: passy

Differential Revision: D15845598

fbshipit-source-id: 3e0d1baf93b6be5c4d1c6c1d2b64c05852b843b7
2019-06-17 03:05:40 -07:00
Pascal Hartig
f0d7667b3e Add missing snapshot test
Summary: Don't know how this landed without?

Reviewed By: jknoxville

Differential Revision: D15826033

fbshipit-source-id: 4895d26620b868b99429c7a6f290c05e1e805b8d
2019-06-14 10:28:12 -07:00
Arthur Kushka
1e700b944c Implemented insights tab in sidebar of networking plugin
Summary:
https://pxl.cl/Cd84

In React VR we got a case to explain developers why their requests took so long. To do this we export timings from Curl and send them in Flipper. This diff added visualization for this data. Any other platforms can use this feature by extending json which they send to Flipper.

Reviewed By: jknoxville

Differential Revision: D15804247

fbshipit-source-id: 9deea5c9f5f7c5416b42c476f7f0ed431c8dea04
2019-06-14 09:29:34 -07:00
John Knox
08454c056b Allow multi-highlight in db plugin
Summary: Enable highlight of multiple rows so they can be copied

Reviewed By: passy

Differential Revision: D15822749

fbshipit-source-id: 2302ddd27a57574c1eaf1f1395939c9f006ba301
2019-06-14 09:13:52 -07:00
John Knox
062cbc0dbd Fix contextClick after multi-highlight
Summary:
Select multiple rows, and then right click, or use Ctrl-click.
This was broken, it was resetting the selection when this happened.
This fixes it.

Now after selecting multiple, what happens depends where you right-click.

If you right-click within the current selection, it stays selected and you can copy it.
But if you right-click outside the current selection, that row becomes the new selected set, and you will just be able to copy that one. This feels right to me.

Reviewed By: passy

Differential Revision: D15822668

fbshipit-source-id: 6a6cda8a8f16fec55cffa52c1c2ff958c86b3f43
2019-06-14 09:13:52 -07:00
Pascal Hartig
0eca3ac1e1 Fix getActiveNotifications crash
Reviewed By: danielbuechele

Differential Revision: D15822750

fbshipit-source-id: 1f8f41437db842197e6ab74e0559a710f80ff786
2019-06-14 09:02:22 -07:00
Pascal Hartig
61365662f6 Fix icons
Summary:
`cross-outline` doesn't seem to be a thing anymore.

https://external.xx.fbcdn.net/assets/?name=cross-outline&variant=filled&size=16&set=facebook_icons&density=1x

Reviewed By: danielbuechele

Differential Revision: D15822731

fbshipit-source-id: d0becbd9faa60393a4be1ef9f4d6bf8da7e9bc20
2019-06-14 06:56:56 -07:00
John Knox
a82934490e Fix process exit when error occurs
Summary:
When running in headless mode, if SIGINT is received, but there's a failure to export the state the process doesn't exit. Repeated SIGINTs do the same thing.

This changes it to exit whether the export succeeds or not.

Reviewed By: passy

Differential Revision: D15806412

fbshipit-source-id: 1f6a5b4ea1cd65dacb201f8a1cd020531b3976e6
2019-06-14 05:21:01 -07:00
Daniel Büchele
766996b8dd keytar update node v70
Summary: Keytar binaries weren't updated when upgrading the electron version. This diff updates the binaries to match electron's node version.

Reviewed By: passy

Differential Revision: D15821734

fbshipit-source-id: 04688f1e465d2f7bdefecfdda8e2f3868de18780
2019-06-14 03:41:54 -07:00
Pascal Hartig
71575ce7cf Hook up stacktraces to leak notification
Summary: Transfer it from the device, reformat the notification to make use of it.

Reviewed By: danielbuechele

Differential Revision: D15779267

fbshipit-source-id: 747dc7f895528618ff6a07c15b7f72bf6a1adde9
2019-06-13 11:18:03 -07:00
Pascal Hartig
6168b3c604 Upgrade to Fresco 2.0.0
Summary: Need a Fresco release including the previous diff first.

Reviewed By: danielbuechele

Differential Revision: D15762090

fbshipit-source-id: ec30778ffc1cd3e48dcfc4d514a9ba13fb26fd75
2019-06-13 10:18:20 -07:00
Daniel Büchele
eb36e667d4 iOS CLI version mismatch detection
Summary:
Trying to detect version mismatches between the running Simulator and the version of Xcode's CLI tools.

What is done in this check:
- The running path of the running simulator is queries from `ps`
- The path of Xcode CLI tools is queried using `xcode-select -p`.
- The two paths are compared if they differ

Reviewed By: jknoxville, passy

Differential Revision: D15803238

fbshipit-source-id: 6638312505fc950ff7869fd55494984bfffb677b
2019-06-13 06:42:16 -07:00
Pascal Hartig
fd89d73be5 Keep track of a Throwable if custom LeakTracker is set
Summary:
This makes it easier to track down leaks as we currently only have their class names. There are some limitations if this is creates on a separate thread, but that can be addressed separately.

This does require temporarily removing the Flipper integration as the interface changes in a backwards-incompatible manner. This will be restored with the next diff in the stack.

Reviewed By: oprisnik

Differential Revision: D15760947

fbshipit-source-id: 3a5c48f6244f1afc8b7e00230bd1ae2f197e6cdf
2019-06-13 04:12:41 -07:00
Pascal Hartig
f2986f8a2f Update README.md (#465)
Summary:
Trying to address https://github.com/facebook/flipper/issues/464.
Pull Request resolved: https://github.com/facebook/flipper/pull/465

Reviewed By: danielbuechele

Differential Revision: D15778823

Pulled By: passy

fbshipit-source-id: 5bddd7914575fe5a53b53b6a7aee11e4777d9f57
2019-06-12 04:31:10 -07:00
Pritesh Nandgaonkar
7d8db465e1 Bump Folly dependency for Android (#463)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/463

Was made aware [here](https://github.com/facebook/flipper/issues/461) that
we currently don't build with NDK 20 because of Folly. The above issue exists only for x86 platform and not for other platform. I have updated the folly and RSocket. Although this diff doesn't solve the issue mentioned above for x86, but it updates the dependencies to the latest version. To mitigate temporarily, I have updated the gradle to not build for x86.

Reviewed By: passy

Differential Revision: D15713205

fbshipit-source-id: 79dd5825b0b876c87a1868fde8f3353a76012267
2019-06-12 03:40:19 -07:00
John Knox
173ce43192 Add sample app layout snapshot test
Summary:
This is fairly experimental. The test passes, but I don't know how stable it will be when litho changes for example.

However, it's easy to exclude specific attributes from the hierarchy, so maybe we can iterate if it breaks at first.

It just takes a snapshot of the layout hierarchy from headless flipper, and compares it to it's known one.

To run it:
`cd headless-tests && DEVICE=emulator-5554 yarn test` while you have the sample app running on an emulator.

To update the snapshots, just add `-u` to the end of that command.

Reviewed By: danielbuechele

Differential Revision: D15715674

fbshipit-source-id: 4fe6f83b60f8003d48aceb6468d93c075e6c38b8
2019-06-12 03:29:58 -07:00
David Aurelio
c4f395dda2 Allow more alignments
Summary: Allows `flex-start` and `flex-end` as aligment values on table cells.

Reviewed By: danielbuechele

Differential Revision: D15754424

fbshipit-source-id: 67449e429e6841800cfab7728f51e2d59cb36f0f
2019-06-11 09:23:13 -07:00
Jan Rabe
8dc9e5aee2 adding PreferenceManager.getDefaultSharedPreferencesName to default (#454)
Summary:
Adding context [PreferenceManager.getDefaultSharedPreferencesName](https://developer.android.com/reference/android/preference/PreferenceManager.html#getDefaultSharedPreferences(android.content.Context)) by default.

## Changelog

Adding context default shared preference by default.
Pull Request resolved: https://github.com/facebook/flipper/pull/454

Reviewed By: jknoxville

Differential Revision: D15759223

Pulled By: passy

fbshipit-source-id: d0770444ce2ea43e2c9bfdc9969532d330f71488
2019-06-11 08:56:25 -07:00
Daniel Büchele
79414aa3e1 Bumped electron version
Summary:
We in React VR were need newer Chrome DevTools version to make our plugin work properly. Chromium version with required fixes were shipped in electron 5.0.0.

This diff bumps electron version and explicitly allows node integration (accessing require, process and other node related functions from window object in index.html), because it was disabled by default in 5.0.0.

Reviewed By: jknoxville

Differential Revision: D15693539

fbshipit-source-id: 4f71a07b2afaa489aec46940c924f4ad30ad0413
2019-06-10 10:36:25 -07:00
David Aurelio
844cabd5d3 ElementsInspector: Allow for custom row decorations.
Summary: Adds the capability to customize rows in the elements inspector via a callback.

Reviewed By: danielbuechele

Differential Revision: D15738355

fbshipit-source-id: 27b91a74535736318b7fdb9d2eb44dfa20b4d77b
2019-06-10 08:39:05 -07:00
David Aurelio
1d38078982 Remove unnecessary $FlowFixMe
Summary: No longer necessary, after flow types for `lodash.memoize` were added.

Reviewed By: jknoxville

Differential Revision: D15738356

fbshipit-source-id: 3c911e5eefee347ca69a37051fd5279c5de47873
2019-06-10 08:39:05 -07:00
Pascal Hartig
9998ad8367 Bump Kotlin to 1.3.31 (#462)
Summary:
Making sure we stay up-to-date.
Pull Request resolved: https://github.com/facebook/flipper/pull/462

Reviewed By: jknoxville

Differential Revision: D15738557

Pulled By: passy

fbshipit-source-id: 9c700fa06b1959dd05762c435d7b859670125986
2019-06-10 07:49:38 -07:00
John Knox
3fcd9c8e51 More specific idb failure logging
Summary: The "Conflict in temp dir" message was misleading when there were 0, rather than >1 file. This fixes that error message.

Reviewed By: passy

Differential Revision: D15716247

fbshipit-source-id: 572addf99f623cdcffd7602dd3935bb69a50d047
2019-06-10 04:13:19 -07:00
Pascal Hartig
10211e4fa1 Update ws dependency
Summary: Addresses security alert https://github.com/facebook/flipper/network/alert/static/yarn.lock/ws/open (WS-2017-0421).

Reviewed By: jknoxville

Differential Revision: D15695745

fbshipit-source-id: e5e24ace95ecccc8e3be65d159c285914bff10dd
2019-06-10 03:55:36 -07:00
John Knox
627ccc2fbc Longer connection wait time
Summary:
I'm seeing some failures where no client is connected when we do the export.
This increases the wait time before sending the SIGINT.

Reviewed By: passy

Differential Revision: D15716214

fbshipit-source-id: 4646ef9d1c37e491273bd9deff504675b0e4e780
2019-06-10 03:50:26 -07:00
Chenhao Xu
c225795b73 flipper CPU plugin sidebar
Summary: Add sidebar to the flipper CPU plugin. Sidebar displays detailed information about the selected CPU core

Differential Revision: D15696198

fbshipit-source-id: 47e687b4354653e6bef626cd3f27adcb219dbd28
2019-06-07 10:09:15 -07:00
David Aurelio
6792fb0bea StatusIndicator: support inline contexts.
Summary:
`StatusIndicator` works well as a flex child, but didn’t support usage in inline / text contexts.

Adding `display: inline-block` fixes that.

Reviewed By: danielbuechele

Differential Revision: D15695673

fbshipit-source-id: 30378d2292390b8d86c0a26c11571e5953b841f2
2019-06-07 08:36:12 -07:00
John Knox
4d6b39ae42 Add test suite for headless
Summary:
Adds a JS test suite for running jest tests against flipper headless binaries. Replaces the jq-based bash script.

Simple sanity test included for all expected top level keys in output JSON.

Reviewed By: passy

Differential Revision: D15625723

fbshipit-source-id: 5ec8e764bcdbb99d9070de704e76a5cd9d8e5dc6
2019-06-07 08:29:45 -07:00
Daniel Büchele
53748da75e UI improvements
Summary:
* expanding/collapsing nodes
* memoizing table rows
* adding sidebar

Reviewed By: davidaurelio

Differential Revision: D15621070

fbshipit-source-id: 9335259d3b4bc1348e917782918eb1e0f678ba17
2019-06-07 08:14:20 -07:00
Pascal Hartig
151ad849cb Re-enable leak tracker
Summary: Restore the temporarily removed leak tracker setup.

Reviewed By: jknoxville

Differential Revision: D15713663

fbshipit-source-id: c98a90ee86173dad7131bfe5b05bb3488f27ae6d
2019-06-07 06:56:14 -07:00
Rain ⁣
aa649ff48f standardize C-like MIT copyright headers throughout fbsource
Summary:
`/*` is the standard throughout open source code. For example, Firefox uses single /*: https://hg.mozilla.org/mozilla-central/file/21d22b2f541258d3d1cf96c7ba5ad73e96e616b5/gfx/ipc/CompositorWidgetVsyncObserver.cpp#l3

In addition, Rust considers `/**` to be a doc comment (similar to Javadoc) and having such a comment at the beginning of the file causes `rustc` to barf.

Note that some JavaScript tooling requires `/**`. This is OK since JavaScript files were not covered by the linter in the first place, but it would be good to have that tooling fixed too.

Reviewed By: zertosh

Differential Revision: D15640366

fbshipit-source-id: b4ed4599071516364d6109720750d6a43304c089
2019-06-06 19:40:28 -07:00
Arnaud Frugier
fa887f4f12 Add documentation for Databases Plugin
Summary: ^^

Reviewed By: jknoxville

Differential Revision: D15666190

fbshipit-source-id: 4b2f5c5544820baa4654b4e52a7e75bd275facc1
2019-06-06 11:17:19 -07:00
Pascal Hartig
afe7c8bf25 Upgrade to Fresco 1.14.2
Summary: Includes the LeakTracker interface change. Restores the temporarily deleted tracker, wires it back up. Requires Fresco 0.14.2 being released which has yet to happen.

Reviewed By: oprisnik

Differential Revision: D15655667

fbshipit-source-id: ab4361be35101efe7564dfdd7a69cba93135eb7e
2019-06-06 08:02:46 -07:00
Pascal Hartig
dc41e2d778 Temporarily remove FlipperCloseableReferenceLeakTracker
Summary:
Ugh, this is the only way we can land the API-breaking next diff. Will
be reverted straight after.

Reviewed By: oprisnik

Differential Revision: D15655666

fbshipit-source-id: c9318e348c187de4562a9a636287cfa7b523356f
2019-06-06 04:54:32 -07:00
David Aurelio
8b7f17d932 Pull out colored disc indicator
Summary:
Pulls out the local `Lamp` component from `PluginDebugge` into `StatusIndicator`.

This will allow to reuse the component in different context, to guarantee a consistent appearance of Flipper throughout.

For good measure, we make diameter and title configurable. Vertical alignment is changed from `margin-top` to `align-self`.

Reviewed By: danielbuechele

Differential Revision: D15692275

fbshipit-source-id: 438b2f5300175565dbf07d07a5d757936b4f7cfe
2019-06-06 04:09:56 -07:00
John Knox
92edb82e13 Exit cleanly after flushing stdout
Summary:
Using `process.exit()` stops the node process without waiting for the event loop to finish, so when using async i/o, which is what happens when piped, if the output is buffered, the process can terminate before it finishes flushing the buffer.

This means you only get some of the output and the JSON is malformed.

This fixes it by calling `process.exit()` inside the flushed callback.

Reviewed By: passy

Differential Revision: D15624806

fbshipit-source-id: ea540ed5a40fb1811e5b705b190da96c8e54730d
2019-06-06 01:59:08 -07:00
Pritesh Nandgaonkar
873475405a Catch the exception thrown in xcrun
Summary: Catch the exception thrown in xcrun, which will occur for linux machines and in the cases when Xcode command line toolchain is not installed.

Reviewed By: passy

Differential Revision: D15621368

fbshipit-source-id: f3044cee6f7a4b5ba927a33003f9690c1fe31586
2019-06-05 11:41:31 -07:00
Pascal Hartig
1973432f78 Add active leak tracking in Fresco
Summary:
Adds a "Track Leaks" option that will show notifications (even retroactively)
for `CloseableReferences` that were tracked.

Reviewed By: danielbuechele

Differential Revision: D15622596

fbshipit-source-id: ef610379aa96f9a5e541f741af608db30bee74e1
2019-06-05 11:34:55 -07:00