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
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
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
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
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
Summary: This diff adds import and export support for the logs plugin
Reviewed By: danielbuechele
Differential Revision: D13958713
fbshipit-source-id: a072de025f0b959302175ef0ccaf763ca41377e9
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
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
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
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
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
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
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
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
Summary: listening on `SIGINT` events and putting the serialized store to stdout.
Reviewed By: passy
Differential Revision: D13878051
fbshipit-source-id: 19c1d857a299ed9a474605169c54e5359e0515bd
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
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
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
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
Summary: This diff updates the check which triggers crash notifications. We got a user feedback that crash reporter used to report non fatal crash too and it used to annoy users with bombardment of crash notifications.
Reviewed By: passy
Differential Revision: D13878272
fbshipit-source-id: 75446f08f806e8f28a6f68953c0a001fd18a7dc0
Summary:
We were using `window.performance` to measure performance. This was because the equivalent node.js API `perf_hooks` wasn't available in the electron version we were using back then.
However, `perf_hooks` has landed in electron meanwhile, so I am moving to this API, as it works for the headless version and jest tests, too.
This allows us to delete the babel transform that was used for node-based tests, where the browser API was replaced with the node API
Reviewed By: jknoxville
Differential Revision: D13860133
fbshipit-source-id: cf1395004fac046dd55751ff465af494173b2cbf
Summary: Adds tests for flipper import and export. Also fixed few edge cases which was discovered through tests. The edge case was that it didn't export device plugin states.
Reviewed By: danielbuechele
Differential Revision: D13828357
fbshipit-source-id: ddc4352b729ca7f05c5875f2f3fbdd2c7f4e2186
Summary:
This diff adds the capability to export the flipper data to a file. With this diff you can click on the "Export Flipper" option from the "Edit" menu in menubar. It will export it in the file at this location
`~/.flipper/MessageLogs.json`
We do not exactly export the store, but just the important part of it. We export in the following format
```
{
fileVersion: '1.0',
device: {
os: 'iOS',
title: 'iPhone 7',
serial: '',
deviceType: 'physical',
},
clients: [
{
query: {
app: 'Facebook',
},
d: '12345678'
},
{
query: {
app: 'Instagram',
},
id: '12345678'
}
],
store: {
pluginState: {},
notifications: {}
}
}
```
In next diff I will add the capability to select the folder to export the file too.
Reviewed By: danielbuechele
Differential Revision: D13751963
fbshipit-source-id: 7d3d49c6adf8145b2181d2332c7dbd589155cec3
Summary:
I must have run this locally on an outdated version of eslint or the
plugin, because I did not see all the formatting errors. This is because
`eslint-plugin-prettier` dropped support for the `fb` preset (see https://github.com/prettier/eslint-plugin-prettier/pull/113/files). This restores the equivalent ruleset explicitly.
Pull Request resolved: https://github.com/facebook/flipper/pull/363
Reviewed By: danielbuechele
Differential Revision: D13839021
Pulled By: passy
fbshipit-source-id: 59e27a241e8aada8648b175ab8abbdfbd391556e
Summary:
Fixes required to be able to run Flipper in node.js:
* Adds checks if the `window`-object exists before using it, to allow running in node.
* Imports from within Flipper should directly reference the file they are requiring instead of `import from 'flipper'`. This was done in most of the places. Fixed a few occurrences where this wasn't the case. This is to prevent cyclic dependencies in node.
* shared packages (React, ReactDOM and Flipper) were exposed on the `window` before, changed this to `global` as this works in browser and node.
* Adds some missing methods to our electron stubs (used for testing and headless Flipper)
Reviewed By: passy
Differential Revision: D13786577
fbshipit-source-id: 145d560f1446e7d0bdec2acd8dd54dae983d7b36
Summary:
Part 3 and final part of adding customizable ports. To use this, the iOS / Android apps have to also be started with the same custom ports.
Example usage: `FLIPPER_PORTS=8189,8188 yarn start`
Reviewed By: passy
Differential Revision: D13801761
fbshipit-source-id: 3dd80a3001ed0855e54cc568fa94eb6fac5fc7f1
Summary: Provide a `--no-updater` option that disables the in-app auto updater when passed.
Reviewed By: jknoxville
Differential Revision: D13713919
fbshipit-source-id: 49a647105fea1efa23f653e4a6ed452b3489879b
Summary: Will provide some visibility on error rates.
Reviewed By: passy
Differential Revision: D13671492
fbshipit-source-id: 60971a7e8163c58dd4d6540e57e05b38c852744e
Summary: This tracker isn't really used, but at least now it can benefit from having the sessionId.
Reviewed By: passy
Differential Revision: D13671367
fbshipit-source-id: 3a79e843e3fabab191d0d7471d56a81b1a91a1e9
Summary:
The advantage of this is that anyone can now log without needing to carry around a Logger object.
Primary reason is for making metrics less intrusive in the codebase.
Reviewed By: passy
Differential Revision: D13671368
fbshipit-source-id: 162ab1351a124683aef13983fc3bcec01385cd1a
Summary: Wraps a future and records the success rate. This will be stored along with the sessionId and the userId, so we can drill down and get the success rate at different levels.
Reviewed By: passy
Differential Revision: D13635049
fbshipit-source-id: 4e0e6bdc0f9b76b08cf37c5d9fe87909f7338534
Summary: This diff adds a static function `onRegisterDevice` which is being called whenever an device gets registered. This callback is used to add loglisterner for android. I even moved the logic of iOS from `onRegisterPlugin` to this callback. The reason for not adding android log listener in `onRegisterPlugin` was that there were cases when baseDevice was not yet registered before calling `onRegisterPlugin`. For android, I want the instance of `BaseDevice` so that I can add logListener on it.
Reviewed By: danielbuechele
Differential Revision: D13563282
fbshipit-source-id: b5be40f3dbc808bdaeabae28423c563cf2345a22
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
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
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
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
Summary: This class already has an adb client. Instead of creating new ones, should just use that.
Reviewed By: passy
Differential Revision: D10231152
fbshipit-source-id: c9426a12f0f6baf94026da51a79131d07e58053c
Summary:
Moving from `arc` to `pastry` to create Pastes.
arc paste is deprecated and throws errors sometimes. Pastry seems to be the tool of choice now and has a nicer API anyways.
Reviewed By: passy
Differential Revision: D10302075
fbshipit-source-id: a846adf3768a2adf5c7ff73dc89b18c1e9169ac0
Summary:
Android devices don't always know their own serial.
But we do a certificate exchange using adb from the desktop, so we can provide it in the response.
After this the client will provide it every time it connects, so we can do things like filter plugins by device id.
For apps that have already done cert exchange, they'll continue to use 'unknown' as their id until they do it again with an up to date version of sonar.
We can think about forcefully stopping that, but I haven't done it.
Reviewed By: danielbuechele
Differential Revision: D9481460
fbshipit-source-id: f8932699711ebbec4260fabe32f87e6cdff920f2
Summary: Makes the code a bit cleaner and maintainable.
Reviewed By: passy
Differential Revision: D9496316
fbshipit-source-id: a59a41b12a57bb2eedc25b154c6f9b0cdc77dd8a