Commit Graph

40 Commits

Author SHA1 Message Date
John Knox
b3a6bf3dba Use named args for ArchivedDevice constructor
Summary: The constructor is getting quite a few args now, so to avoid string, string mistakes I'm making sure you pass objects with named params.

Reviewed By: passy, mweststrate

Differential Revision: D20034012

fbshipit-source-id: 4e0d23eeaa9100c6c19d3e36fee62649659ad261
2020-02-24 19:43:22 -08:00
John Knox
20db85adf4 Add archived device visualizer
Summary:
Adds a visual indicator of layout nodes when using an archived device.

The "device" window isn't movable for some reason. I've tried the movable and draggable attributes but with no luck. It would obviously be good to fix that but I think its probably shippable as is, and I don't have any more ideas about how to do it.

Reviewed By: passy

Differential Revision: D19885719

fbshipit-source-id: 186ba38c85afee18ce111e30187bdccd9b919025
2020-02-21 07:19:13 -08:00
John Knox
6712182fd1 Capture screenshot during export
Summary:
^

context: https://fb.workplace.com/groups/flippersupport/permalink/804152663398727/

Reviewed By: passy

Differential Revision: D19747718

fbshipit-source-id: 30a06446ba3d7d103332580ab5baad59bbc2481c
2020-02-10 06:05:17 -08:00
Pritesh Nandgaonkar
d9c8b5dd64 Do not fail if there are entries in errorArray from exportStore
Summary:
Currently `exportStore` function returns the serialized string along with errorArray. errorArray contains an error when there is some issue with fetching metadata. Essentially, it keeps the error in the errorArray and continues with fetching the data for the next plugin. Previously we used to exit our submit form execution when the errorArray had any value. So this diff removes that check and instead logs it on the console and in our logging system.
It will handle the case mentioned [here](https://fb.workplace.com/groups/1430200360634661/permalink/2566831316971554/)

This diff also adds a log when there is failure to upload flipper data.

Reviewed By: mweststrate

Differential Revision: D19723674

fbshipit-source-id: 18bf90461156f67ecc2b4ce4b1eac4aa3485188d
2020-02-05 04:30:03 -08:00
Michel Weststrate
6218b00e15 Fix issue where file / link export accidentally included support request details
Summary: When doing a Flipper trace export through the app menu (not the support form), the export still contained a support request details section, with the default data of a bug report. That doesn't make any sense and is confusing, so this change makes sure the report is only included if it is supported through the supportRequestForm

Reviewed By: passy

Differential Revision: D19499408

fbshipit-source-id: ff7a5333f2045f2465966dffa0c5fb03aaeaceb8
2020-01-27 07:22:32 -08:00
Michel Weststrate
82e65c68dc Make sure plugin name selections are displayed consistently with sidebar, [Flipper] Make sure plugins have the same name everywhere
Summary:
Not all plugin names are created equal in flipper. For example, plugins would bear different names in the sidebar and in the plugin selection when making a support request / flipper trace. Fixed this and also introduced a `getPluginTitle` utility that produces this name consistently.

Plugin listview now also sort their items consitently with the sidebar.

Probably also fixed an error in the flipper export screen, where a correct TS error was supressed.

Reviewed By: jknoxville

Differential Revision: D19499404

fbshipit-source-id: c5b23a170d41d96799eb7899e249f70778717d45
2020-01-27 07:22:32 -08:00
Pritesh Nandgaonkar
d31ea742f5 Fix broken URL export
Summary:
Fixes broken export through URL.
Also fixes an issue where we suppress an exception

Reviewed By: mweststrate

Differential Revision: D19517066

fbshipit-source-id: c68b6a1bcbc8b0588e0db9032268033a42b43c61
2020-01-22 10:07:59 -08:00
Chaiwat Ekkaewnumchai
bacb1958fc Back out "Back out Electron 7.1.1/7.1.2 upgrades"
Summary:
Original commit changeset: 05d13aca7145

Attempt to upgrade `electron` as it instacrashed; `electron-builder` version 22.1.0 didn't sign package correctly and caused the instacrash,

Reduced the version to 21.2.0 (latest).

Reviewed By: passy, nikoant

Differential Revision: D18954671

fbshipit-source-id: bc2dbd4fec9afb51d9a535974651b13d195407b4
2020-01-06 09:44:13 -08:00
Michel Weststrate
5d25b77622 Bug: cannot export data / submit bug without selected device / client
Summary: Without selected device or client, it is currently impossible to submit a bug report. This diff fixes that.

Reviewed By: jknoxville

Differential Revision: D19251701

fbshipit-source-id: fd0dc0c779fb27d93ed02a404da76a7e6b251b94
2020-01-02 07:14:15 -08:00
Michel Weststrate
b8e752412e Process queues before exporting plugins
Summary: This diff makes sure that pending queues for plugins that are selected are processed before making a flipper export.

Reviewed By: jknoxville

Differential Revision: D19194211

fbshipit-source-id: e076375889450407e7f94384051719f3bbc415ee
2020-01-02 07:14:13 -08:00
Michel Weststrate
02ad5c64aa Fix last startup warnings
Summary: There were a few warnings printed when starting Flipper. This fixes the last of them!

Reviewed By: nikoant

Differential Revision: D19011385

fbshipit-source-id: 15bc46c4a67e8c8fd3c8b5d96dc67e61911a7e53
2019-12-13 07:11:43 -08:00
Pritesh Nandgaonkar
938f9542ee Fix the issue where perf events were not getting logged
Summary: I noticed a bug where the export data perf events were not logged. The issue was that, it used the `Logger.getTrackTimeSince` method which used the `performance` from `perf-hooks` and not an ordinary performance object available in the global scope. So just importing performance from perf-hooks solved the issue.

Reviewed By: mweststrate

Differential Revision: D18887666

fbshipit-source-id: 66c24f47b95b25d2f3703c16c70cbe8b35fe0ec3
2019-12-10 08:21:28 -08:00
John Knox
0bf905e02f Replace all manual pluginKey parsing with a utility
Summary:
Ok this diff got a bit bigger than expected, but I think it makes it easier to understand what "plugin keys" are, and makes them less prone to error.

Previously pluginKeys were composed of: clientId#pluginName, where clientId was itself: app#os#device#device_id

But also, there were some plugin keys where the clientId was a device_id.

Now you deconstruct a plugin key, and will get a tagged object with type: 'device' or 'client', and the properties that they each have.

There is now no custom parsing of these afaik, let's keep it that way.

Since it took me a while to figure out what all these IDs are, I've documented it a bit in clientUtils.

Reviewed By: passy

Differential Revision: D18811848

fbshipit-source-id: eed2e2b5eedafb9e27900dbcf79a389fcaffae95
2019-12-05 07:37:57 -08:00
John Knox
c95ecf6b3e Unifying use of clientID utils
Summary:
Fixes a couple of typo's and merges two very similar functions into one.
Now that there's a single way to create a clientID, we can get more strict about what it is and what it isn't.

Reviewed By: passy

Differential Revision: D18809741

fbshipit-source-id: 9a68e45bead38cc2917a6d4cd2cf461c309f3ede
2019-12-04 08:40:09 -08:00
Pritesh Nandgaonkar
d21be33b9a Update app name on client change
Summary: This diff refactors the way appName is shown. We populate the appName through selectedApp, thus keeping different redux prop is not needed. This diff gets rid off the appName prop from the redux store and makes sure that appName gets updated on client change.

Reviewed By: mweststrate

Differential Revision: D18764685

fbshipit-source-id: 5ff94c83f84b03bbee34518aface46d4544af77f
2019-12-03 04:51:04 -08:00
Pritesh Nandgaonkar
ca53f35875 Refactor export data functions and exportpersistedstate function to just expect state
Summary: This diff refactors the `exportpersistedstate` and few of the functions in exportData.tsx to just expect the Redux State instead the store object.

Reviewed By: mweststrate

Differential Revision: D18733011

fbshipit-source-id: 56739917b49142ba4b6e79e7c16378fe60d6ac3b
2019-11-28 03:49:26 -08:00
Pascal Hartig
a75a52a25b Back out Electron 7.1.1/7.1.2 upgrades
Summary:
Original commit changeset: eddfbb3571c7
Original commit changeset: f7300f527b65

Pains me to do this, but probably our best chance right now to get a release out.

Reviewed By: cekkaewnumchai

Differential Revision: D18687890

fbshipit-source-id: 05d13aca71457ca6dd19f5b45d58158ae223e66f
2019-11-26 05:30:34 -08:00
Michel Weststrate
dd65ec6ed0 Make it possible to export support form V2 with meta data
Summary:
This diff enables a full roundtrip of exporting a bug report to file / link, and importing it again.

Styling is not part of this story.

Reviewed By: jknoxville

Differential Revision: D18636418

fbshipit-source-id: ef9a8e3622bdac9361f612d51415a593f4268b80
2019-11-21 08:01:49 -08:00
Michel Weststrate
d97675f2e6 Fix broken export functionality
Summary: This fixes a regression bug introduced by the rework sidebar selection: when trying to export a Flipper Trace flipper would error: 'No client exported' after making plugin selection

Reviewed By: priteshrnandgaonkar

Differential Revision: D18571143

fbshipit-source-id: c7a292e53cb79d0b2d95e09f8e9b041ae0d711cf
2019-11-18 08:32:44 -08:00
Michel Weststrate
f22e373136 Improve support request details import form
Summary:
Created as standard layout that can be used for both the import and export form

Standardized components used, so that we work towards a Design Framework that is consistent. Took inspiration from some existing plugins.

Also fixed weird sidebar transparency.

Reviewed By: passy

Differential Revision: D18504078

fbshipit-source-id: 7649abf7aa3eba8ba635337a41274bba93738e81
2019-11-18 02:21:15 -08:00
Michel Weststrate
9f7be13e39 Rework sidebar selection
Summary:
- Make sure newly connecting apps are automatically selected
- Improved the sidebar UI by using more consistent, spacious styling, and giving some more attention to error states

Reviewed By: passy

Differential Revision: D18505636

fbshipit-source-id: 18b2c8e78be13aabb3a54c60553f6b0d1e613b27
2019-11-18 02:21:14 -08:00
Michel Weststrate
d2ab55a6f8 Introduce support request details form
Summary: Initial setup for a support detail form. Will only show up if meta data is present in the flipper file, so use the attached one to see it.

Reviewed By: jknoxville

Differential Revision: D18479193

fbshipit-source-id: 61da089f1e883fea20b2422a6bea99b2f8a4434b
2019-11-14 05:46:14 -08:00
Chaiwat Ekkaewnumchai
a578b4d559 @allow-large-files [flipper][deps] Upgrade Electron (#636)
Summary:
allow-large-files

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

per title

Reviewed By: jknoxville

Differential Revision: D18374332

fbshipit-source-id: f7300f527b65b65caebac51c5bcf8f019dc34228
2019-11-13 10:51:16 -08:00
Michel Weststrate
dcb6595d1d Make imported devices visually recognizable
Summary:
If a flipper file is imported, from now on we will show that fact in the sidebar to make it more clear we are looking at an imported device. Beyond that, those devices are marked as `(imported)` rather than `(offline)` to distinguish between offline and imported devices.

This should help with future feature like cross device applicable actions.

Reviewed By: jknoxville

Differential Revision: D18448190

fbshipit-source-id: 560084f010207c99cecd616e43a6cc02e62cbc7a
2019-11-13 08:36:56 -08:00
Michel Weststrate
989b32c7b9 only capture selected application in exports
Summary:
Currently flipper export exports all connected the clients. This causes a few problems

1. This might often be unintended by the user, causing accidentally sharing (sensitive) information in the trace
2. This slows down things unnecesary. Especially if there is connected application, which is expensive, but not needed. See the attached video for the impact on exporting flipper: Export size reduzed from 11 to 0.5 mb. Export time from 20 seconds down to 1. (Flipper might not be a representative example, but imagine working on fb4a and having instagram on the emulator as well).

Reviewed By: priteshrnandgaonkar

Differential Revision: D18448194

fbshipit-source-id: f4de4c6dd89bda20251eb5f7423f7996339c8f2d
2019-11-13 08:36:55 -08:00
Pritesh Nandgaonkar
f4a42cc4ea Add more telemetry events
Summary:
Added more telemetry events for the following events

- Time taken for each plugin to fetch meta data
- Overall time taken for fetching all meta data
- Overall time taken for serializing plugins
- Time taken to serialize individual plugins with overridden serializer and deserializer methods

Reviewed By: passy

Differential Revision: D18349588

fbshipit-source-id: 2b3a6b663a9df4da45580fc0be5651a27ca4093d
2019-11-08 05:05:02 -08:00
Pritesh Nandgaonkar
f6e00136ba Add telemetry for export time and selected plugins
Summary: Adds telemetry for the export time and also logs the selected plugins.

Reviewed By: jknoxville

Differential Revision: D18244843

fbshipit-source-id: 36a3e8b9b456b59187918d19075a2c1ea0caef25
2019-10-31 09:40:51 -07:00
Pritesh Nandgaonkar
e73381a85c JSON.stringify over custom serializer
Summary: This diff calls JSON.stringify on the final export object instead of the custom serializer. As the custom serializer is slower, because it has to check for different types on its children before serializing it. Which adds to the complexity. The time gain which we get is 3x, that is with this change the export is 3 times faster. We required custom serializer, because the logs had `Date` which is not serializable. So that is being taken care while importing it.

Reviewed By: jknoxville

Differential Revision: D18171202

fbshipit-source-id: cd1b59b74dabb4c35a032dc7b54f183a68e37823
2019-10-29 13:47:01 -07:00
Pritesh Nandgaonkar
f49745448c Pass the status Msg as an argument
Summary: Before this diff whenever one called serialize method it showed `Serializing Flipper  ` msg without showing the explicit details of which data we are serializing. Thus with this diff one can pass the status msg as an argument which will be displayed while serializing.

Reviewed By: jknoxville

Differential Revision: D18173024

fbshipit-source-id: a4e7e073498993626204061d4e774099f00b8c5a
2019-10-29 13:47:00 -07:00
Pascal Hartig
874e590b96 Upgrade eslint and prettier
Summary: Not a fan of the long lines, but if that's where prettier is going, let's roll with it.

Reviewed By: jknoxville

Differential Revision: D17905599

fbshipit-source-id: c4232d46d2ec0b7c743f6afd8349106c85f013b9
2019-10-14 05:27:27 -07:00
Andres Suarez
0675dd924d Tidy up Flipper license headers [1/2]
Reviewed By: passy

Differential Revision: D17863711

fbshipit-source-id: 259dc77826fb803ff1b88c88529d7f679d3b74d8
2019-10-11 13:46:45 -07:00
Pritesh Nandgaonkar
e0e0a8f916 Add device argument in the constructor of Client
Summary: Property `device` on Clients for archived device never resolve. As it gets resolved when `addConnection` is called which happens for real non-offline devices. To get around this, I have added an argument to the constructor of the Client, as for offline case we can construct the device before client and can pass it as an argument.

Reviewed By: jknoxville

Differential Revision: D17831261

fbshipit-source-id: a14fb0b65343cccac731077e983026388611d323
2019-10-10 08:22:52 -07:00
Pritesh Nandgaonkar
7f2f2febcf Make MobileConfig plugin exportable
Summary: As per title, this diff makes the Mobile config plugin exportable. This involves moving the important property from `State` to `PersistedState`. Also had to implement the `exportPersistedState` function to fetch the experiments information for the Universes, configs and gatekeeper information.

Reviewed By: danielbuechele

Differential Revision: D17633986

fbshipit-source-id: 604225ba47112620bee0a6c704416b3ac350de9c
2019-10-07 09:57:31 -07:00
Pritesh Nandgaonkar
6e6873a4f6 Pass idler and statusupdate callback as an argument to the export persisted state function
Summary: This diff passes the idler and statusUpdate arguments to the export persisted state, as it is being used in the MobileConfig's export function

Reviewed By: passy

Differential Revision: D17715815

fbshipit-source-id: 98a0f0f5950254de2139c4aaa52cb73401c86c3c
2019-10-04 05:33:44 -07:00
Pritesh Nandgaonkar
d8cd69666e Strictify exportData.tsx
Summary: As per title.

Reviewed By: jknoxville

Differential Revision: D17269583

fbshipit-source-id: efb67acade677f26ce3d2a547d0ab97329d80196
2019-09-10 08:50:28 -07:00
Pritesh Nandgaonkar
566f2bf96e Do not use custom serializer for all the plugins
Summary:
This diff solves the problem where the export for the graphql plugin was super super super sloooooowwww...... The reason being that the graphql plugin had chunky graphql responses which were json blob which was being serialized by our custom serializer. Instead of serializing those with custom serializer we can directly serialize them as they won't have any map's, sets, classes etc.

This diff adds the two static functions on the plugin which will provide the serialized and deserialized object for the persistedstate. As the plugin knows the structure of its state it can optimize the serialization and deserialization of its data.

This change solves the slow export issue and makes it blazing fast..... 🏎

Bug:

{F206550514}

Reviewed By: danielbuechele

Differential Revision: D17166054

fbshipit-source-id: 058b903c03c12c9194702162c46763ef5b5e7283
2019-09-09 06:13:39 -07:00
John Knox
b4c1d1942a Make File > Open more self-explanatory
Summary:
Yesterday I saw someone try to open the xcode executable with the File > Open function.

This made me realise it's not clear what this is for, and you might think it can open all kinds of things.

Reviewed By: danielbuechele

Differential Revision: D17225496

fbshipit-source-id: 893360a1f450a8db25be34fce6c288e8db8f9626
2019-09-06 04:14:58 -07:00
Pascal Hartig
0f270c9f48 Migrate packageMetadata
Summary: _typescript_

Reviewed By: danielbuechele

Differential Revision: D16782045

fbshipit-source-id: cfbabc036eb707f76a375f451ccc831b25c6d462
2019-08-14 04:43:51 -07:00
Pascal Hartig
6c7aeef7ed Migrate exportMetrics
Summary: _typescript_

Reviewed By: jknoxville

Differential Revision: D16712087

fbshipit-source-id: 63dc45a26eb8112aef2b1bfa0d67bf57aa9ec72a
2019-08-12 03:53:16 -07:00
Pascal Hartig
99ca6aa7e8 Migrate exportData
Summary: _typescript_

Reviewed By: jknoxville

Differential Revision: D16711940

fbshipit-source-id: 2e0e5cd0440fe1cdb7bd29af94e22c7f6b9137f8
2019-08-12 03:53:15 -07:00