Commit Graph

337 Commits

Author SHA1 Message Date
Luke De Feo
ea22ed8f56 Force logged in
Summary:
This diff introduces a few changes:
The login sheet is no longer closable via the x or clicking outside the modal, the cancel button is removed
On startup we check if we have a toke and throw up the sheet
if logout occurs for any reason we throw up the sheet

renamed write_keychain to login, to be consstent with the logout method. It does more than write to key chain since it manages the logged in atom also

Reviewed By: aigoncharov

Differential Revision: D44502483

fbshipit-source-id: 1d91d4eaae65ca523a08e205d1ad730d4d4d090f
2023-03-30 10:05:59 -07:00
Luke De Feo
90069381e8 Clean up cache and redux store after logout
Summary: There were redundant places we were cleaning up and logging out, now all syncronisation between the atom world and everything else is done via the atom subscription.

Reviewed By: aigoncharov

Differential Revision: D44463888

fbshipit-source-id: 9fc2af64b1e0667dd852096557107a48f2fa924c
2023-03-30 10:05:59 -07:00
Luke De Feo
91c5a11e1b Add state to login button when disconnected
Summary: Indicate intern connection state via an icon, now that we are polling when offline this icon automatically goes away one we reconnect

Reviewed By: aigoncharov

Differential Revision: D44502479

fbshipit-source-id: fb411940f1e4cad50539fe08df6d6194b176404a
2023-03-30 10:05:59 -07:00
Luke De Feo
3a85835a9a Sync login atom to prescense of token
Summary:
Logged in state now means that we have a valid token. On startup we try to retrieve a token, if its there then we are logged in, if we remove the tokem, due to explicit logout, or if its expired we are logged out.

Connected is more dynamic, it means we can actually hit intern with a sucessful response. It implicitly requires a token / being logged in

Reviewed By: aigoncharov

Differential Revision: D44502482

fbshipit-source-id: e3077101766cba5128a61d62be3bbd1ca1f00b4f
2023-03-30 10:05:59 -07:00
Luke De Feo
5a6091f6f8 Left rail log in icon decided by atom, cache user profile
Summary:
Previously the left rail state was decided by prescense of user profile but we are moving to logged in state being based on the atom.

As a result we need to cache the user profile so we have something to display when user not on vpn on startup

Reviewed By: aigoncharov

Differential Revision: D44502477

fbshipit-source-id: 11462d24c773d6d364e844b4f606e124e5278348
2023-03-30 10:05:59 -07:00
Lorenzo Blasa
cb11b360fc Use theme colours
Summary:
Stacktrace component was not properly displaying on Light/Dark mode as it was using colours not from the theme.

This change addresses that.

Reviewed By: ivanmisuno

Differential Revision: D44537750

fbshipit-source-id: 1d95313bfc9b5ef386864fa230348b76dce6d648
2023-03-30 08:43:54 -07:00
Andrey Goncharov
35c145463a Limit notification length
Summary: See https://fb.workplace.com/groups/flippersupport/permalink/1593262167821102/

Reviewed By: antonk52

Differential Revision: D44459787

fbshipit-source-id: ef14e560c523fddf4f815d0faafa37e44dc416b8
2023-03-28 07:00:20 -07:00
Andrey Goncharov
d67b073f20 Enhance global error handling
Reviewed By: lblasa

Differential Revision: D44332732

fbshipit-source-id: d36b47e820906213cb829fb7d4d2f3b60ae08c71
2023-03-23 07:08:22 -07:00
Andrey Goncharov
ccbc4770f5 Log component stack if a component crashes
Summary: Currently, component crashes are missing component stack traces. Without them, crash bot reports are impossible to debug.

Reviewed By: ivanmisuno

Differential Revision: D44331421

fbshipit-source-id: 0ebd160b4f2f64db40dae29dd9fc350d8d28d802
2023-03-23 05:16:54 -07:00
Andrey Goncharov
b76c8a390c Add excessive logging for "deinit" method for Msys plugin
Summary: Debugging T141716711

Reviewed By: antonk52

Differential Revision: D44295078

fbshipit-source-id: 5269c7308e71d8b2ba7881747fcd5cbe37d81729
2023-03-22 07:34:39 -07:00
Michel Weststrate
3751d3c84c More elaborate error message when plugin download fails
Summary: See https://fb.workplace.com/groups/flippersupport/permalink/1586389021841750/. Flipper suggests that not connecting to VPN is the problem, while the problem can also not being logged in.

Reviewed By: antonk52

Differential Revision: D44164192

fbshipit-source-id: 993d2a4bdc6a9cb0c45f35856b83449cea294d45
2023-03-17 06:35:32 -07:00
Lorenzo Blasa
b062ee0629 Fix feedback prompt on dark mode
Summary:
https://pxl.cl/2tKXq

It was reported the feedback prompt title was unreadable.

Reviewed By: mweststrate

Differential Revision: D43533800

fbshipit-source-id: f756a9822c479105dae890159518c05c99405fb7
2023-02-23 05:53:31 -08:00
Lorenzo Blasa
26a7e17df6 Remove unused import
Summary: ^

Reviewed By: mweststrate

Differential Revision: D43533768

fbshipit-source-id: ffcec138c294ad97bf7879e600894e2615a03f45
2023-02-23 05:53:31 -08:00
Michel Weststrate
6196204a7b Plugin download failure is not an error
Summary: Plugin download failure is typical a transient error, no need to trigger monitoring for that

Reviewed By: ivanmisuno

Differential Revision: D43118116

fbshipit-source-id: 0cd0f87f0ed6123adcba28139308ecea92b1b508
2023-02-10 02:22:50 -08:00
Luke De Feo
64a6c651e7 Quieten some error logging
Reviewed By: mweststrate

Differential Revision: D42603959

fbshipit-source-id: 52527e3799ed1bbb870466648de13c36cb1f6722
2023-02-03 04:06:40 -08:00
Pascal Hartig
7d58037ad6 Improve errors around screen capture
Summary:
Tasks like T143443148 pop up frequently and are inactionable. This is usually due to device flakiness, storage being full, incompatibility or configuration problems.

Start and stop were also copy-pasted to make matters worse.

Reviewed By: ivanmisuno

Differential Revision: D42800489

fbshipit-source-id: 11caaa4133e4fa1d773364a6ba4e5f5bb0d2f2ce
2023-01-30 03:18:19 -08:00
Andrey Goncharov
10e415655c Fix table flickering without hiding content
Summary:
Followup of D39772453 (2437aeb3e9)
Fixes https://fb.workplace.com/groups/flippersupport/permalink/1518236858656967/

1. Stop using clientWidth and offsetWidth because they have rounding errors
2. Since step 1 did not resolve the issue entirely (for some weird reason I do not really have the capacity now to investigate - my bet it is a rounding error when you sum up doubles) set offset of the table to "scroll" instead of "auto". As a result, it starts rendering space for the scrollbars all the time, but since Flipper is a dev tool it should be fine

Reviewed By: antonk52

Differential Revision: D41839402

fbshipit-source-id: cf50eb1600b692d3970003fd1b45b953ee45e3df
2022-12-09 04:06:58 -08:00
Ranesh Saha
7a28ed1fe5 Pipe through --updater/--no-updater flag for flipper.exe (#4277)
Summary:
In our organization, Flipper is distributed in a version controlled way. As a result, we do not want users to manually update or receive prompts to update when a new version is available. There is already a `--updater` flag in the command line arguments for flipper.exe, but it isn't piped through. This change pipes it through and disables all update related UI when `--no-updater` is passed in.
## Changelog

Support --updater and --no-updater options for flipper.exe

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

Test Plan: Ran `yarn build --win` in flipper/desktop, and launched flipper.exe from flipper/dist/win-unpacked with the `--updater`, `--no-updater` and no flags and ensured the proper behavior was observed (update UI shows by default or when `--updater` is specified, and doesn't show when `--no-updater` is specified).

Reviewed By: passy

Differential Revision: D41298321

Pulled By: mweststrate

fbshipit-source-id: 5ddfede2700954f0fdd6a111b20d0836fab25565
2022-11-15 03:23:55 -08:00
Lorenzo Blasa
587f428cf8 Allow plugins to use css
Summary:
Flipper plugins fail when importing css from third-party dependencies. This diff tries to fix that.

Effectively, the plugin can import the css and export it when is bundled.

When we load the plugin, we check if there's a css file for it. If there's one, we return it and try to use it.

Reviewed By: aigoncharov

Differential Revision: D40758178

fbshipit-source-id: e53afffcc481504905d5eeb1aea1f9114ee2a86b
2022-10-27 22:50:30 -07:00
Andrey Goncharov
06dbcecfad Open support request when user creates a universal export
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/ed

It does not make too much sense to have 2 different entry points to export Flipper debug data and to create a support request. It only creates ambiguity for our users. We could open the support request form automatically for them every time. In those rare cases when they try to attach new data to an existing support request, they can always not submit the form.

Reviewed By: passy

Differential Revision: D40632145

fbshipit-source-id: 6ca454d6e885493b32ac3aad008482045dccf51d
2022-10-25 05:31:48 -07:00
Andrey Goncharov
778a56d7ac Create and upload a universal export when using the support request link
Summary: Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Reviewed By: passy

Differential Revision: D40586468

fbshipit-source-id: 4d6a8706c7d1cad1951bda701c51f0998c985628
2022-10-25 05:31:48 -07:00
Andrey Goncharov
5d921966fb Introduce the Rage button to users
Summary: Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Reviewed By: passy

Differential Revision: D40553286

fbshipit-source-id: 5007e2df9979ed7897af380cd7595173e634fb5a
2022-10-25 05:31:48 -07:00
Andrey Goncharov
14bdc87b11 Remove Flipper logs export menu
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

We have a universal export now. Why would we ask for logs only?

Reviewed By: passy

Differential Revision: D40553127

fbshipit-source-id: 674482e39746e789d70bf800daa5f021d83bb093
2022-10-25 05:31:48 -07:00
Andrey Goncharov
2289d6c0e2 Create a partial universal export in case of errors
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Attach what we can to the universal export file if any of the steps time out

CHANGELOG: Add a universal debug export button

Reviewed By: passy

Differential Revision: D40552235

fbshipit-source-id: 775afccacf053fbcf764d1f39e93a89ad20dee0a
2022-10-25 05:31:48 -07:00
Andrey Goncharov
80f947212b Add a modal with status updates for the universal export
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Exporting all files form a device and export Flipper's own state could take a long time. We need to keep our users updated on the status.

Reviewed By: passy

Differential Revision: D40551661

fbshipit-source-id: d5c94fb99d4bc8b4495ce463915b77c475548f01
2022-10-25 05:31:48 -07:00
Andrey Goncharov
96aa0ac02b Automatically export all plugins as a part of a universal export
Summary: Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Reviewed By: passy

Differential Revision: D40550440

fbshipit-source-id: 2f88c84124c35524d020fd2bcd8487dc2c64d8f3
2022-10-25 05:31:48 -07:00
Andrey Goncharov
6af6652ab2 Export data for the universal export as a single zip archive
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

It is better UX not to prompt a user multiple times to save various pieces of the debug export

Reviewed By: passy

Differential Revision: D40550084

fbshipit-source-id: 51ea3acee7daf5074682219020e1e1eed2182b7d
2022-10-25 05:31:48 -07:00
Andrey Goncharov
2db9bccf75 Export client logs for the active client as a part of the universal export
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Introduce a command rto fetch debug data from the devices

Reviewed By: passy

Differential Revision: D40470838

fbshipit-source-id: 40a7ec66b1266ceff1b31b5b4f19b93765b78615
2022-10-25 05:31:48 -07:00
Andrey Goncharov
ef0d9fb77e Export Flipper state as a part of the universal export
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Create Flipper export as a part on the universal export

Reviewed By: passy

Differential Revision: D40468242

fbshipit-source-id: b1b8e4df3b630c6163bb383482123c12dfc6e118
2022-10-25 05:31:48 -07:00
Andrey Goncharov
0e5af8095f Stash and export debug logs
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Stash all logs including debug ones for the export

Reviewed By: lblasa

Differential Revision: D40467905

fbshipit-source-id: 963ce8e92d2131220640a63f5e9c38f4317af061
2022-10-25 05:31:48 -07:00
Andrey Goncharov
be72375d18 Add "Rage" button
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Add a button to export all possible debug data at once. IN subsequent diffs, I'll add more extensive data collection.

Reviewed By: antonk52

Differential Revision: D40467606

fbshipit-source-id: 6a4225945b1feb6c1a8073b5209a62ba0beb6148
2022-10-25 05:31:48 -07:00
Luke De Feo
a520c422eb Improve waiting for new client for deeplinks
Summary:
There were some situations were we would hang waiting for new clients but one had connected.

Additionally the old approach would close and reopen the dialog every time a state update happened in the redux store which was a little jarring. Now the polling of the update is independant the dialog

The dialog still flashes  for other parts of the flow (when scanning for devices) and would be nice to fix this too in the future

Reviewed By: mweststrate

Differential Revision: D40477502

fbshipit-source-id: d1ff161f262493cf5b3fb74e22b49ed65de8c292
2022-10-24 08:07:01 -07:00
Luke De Feo
c6dbfc87a4 Wait for client to initliaze on startup deep link
Summary: We were incorrectly assuming a client did not support a plugin because it was not fully initialized. This issue was only apparant on start deep links

Reviewed By: mweststrate

Differential Revision: D40477503

fbshipit-source-id: 5fd9db765f559b8eb80cc3680ee694dfd2cf9a37
2022-10-24 08:07:01 -07:00
Andrey Goncharov
1f78da881e Enhance a warning about taking too much time to process plugin messages
Summary:
Without seeing the specific messages it might be hard to debug what is taking so long.

CHANGELOG: Enhance a warning about taking too much time to process plugin messages

Differential Revision: D40340272

fbshipit-source-id: a4dbd639cf389763a3cb00a190216c0e653c08e4
2022-10-13 03:40:51 -07:00
Andrey Goncharov
fbbd90e9f5 Suggest a quick fix for EADDRINUSE
Summary:
Show users a way to fix Flipper EADDRINUSE on their own without filing a support request

CHANGELOG: Better error message for EADDRINUSE

Reviewed By: mweststrate

Differential Revision: D40338164

fbshipit-source-id: ec0419c78983b55736aa773757775b5302da51e0
2022-10-13 03:14:06 -07:00
Luke De Feo
71ed2f6e25 Fix deeplinks when flipper desktop is closed
Summary: Previously opening a deep link would always fail with flipper thinking the plugin did not exist.  In this diff we wait for plugins to be initialized

Differential Revision: D40142275

fbshipit-source-id: 7894fc60a6df57e13395e05263b0905847b11ad3
2022-10-07 02:52:43 -07:00
Andrey Goncharov
9597e672a1 Provide @emotion/css to plugins
Summary: Changelog: Provide `emotion/css` to plugins

Reviewed By: antonk52

Differential Revision: D40057817

fbshipit-source-id: 1e931eb8527d62dd4312556a6d493fdf3e17b45a
2022-10-04 05:07:36 -07:00
Andrey Goncharov
d1158e2d02 Configure eslint to prevent imports from nested paths of externally provided modules
Summary: We have a list of modules that we do not bundle with the plugins, but provide externally to them from Flipper. For the mechanism to work correctly, we have to stop importing from nested paths of these modules.

Reviewed By: mweststrate

Differential Revision: D39776237

fbshipit-source-id: 06eae9bf9d5b11b48d2720bf592bfea749773847
2022-09-26 09:42:33 -07:00
Lorenzo Blasa
dfdeffbc09 Use event handlers instead of listeners for error handing
Summary:
^

Adding listeners was correctly intercepting events but the event object often lacked the information necessary to correctly triage and fix an issue.

I discovered that by subscribing to these events directly, the event object did have the required information.

Changelog: Use global window event handlers instead of listeners

Reviewed By: antonk52

Differential Revision: D39809292

fbshipit-source-id: 8a0fc7b7cd86ea16e40f2dc383bc30364f6fc16c
2022-09-26 04:24:33 -07:00
Andrey Goncharov
2437aeb3e9 Fix AutoResizer flickering
Summary: https://github.com/bvaughn/react-virtualized/issues/773

Differential Revision: D39772453

fbshipit-source-id: 613b809201d7dca34a0322c0cc65468f2fba2b08
2022-09-23 12:08:09 -07:00
Andrey Goncharov
31fb3dd5be Stop counting disabled and gatekeeped plugins as loaded
Summary: Without this change gatekeeped and disabled plugins are also counted as loaded, which results in plugin duplication in the UI

Reviewed By: lblasa

Differential Revision: D39695335

fbshipit-source-id: 759e2e0eaead1bee0f7d61e4ba3d1b8e4b6c0976
2022-09-22 04:17:24 -07:00
Ken Yee
fa9ba6f2d0 Adds a notifyAvailableUpdate flag to config.json to disable update (#3992)
Summary:
We would like to version control Flipper and some of our custom plugins that are installed on developers' systems.
Flipper by default prompts users to upgrade so they sometimes do the update and then all our custom plugins break because they were compiled for an older version.
See https://github.com/facebook/flipper/issues/3947 for feature request info.

## Changelog

Adds notifyAvailable flag to config.json to disable prompting for users that "an update is available"

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

Test Plan:
Tested by running locally.
Had to comment out the isProduction() check to confirm this it worked properly because this flag is false on dev versions.
Couldn't figure out how to manually test the handleOpenPluginDeeplink.tsx change but made a similar change there; happy to test that if you can tell me how to exercise that path.

Reviewed By: antonk52

Differential Revision: D39654481

Pulled By: antonk52

fbshipit-source-id: cef6b48d870915c48f620269c42d24b8ef1f4c29
2022-09-21 09:47:44 -07:00
Andrey Goncharov
8716761cb3 Fix require monkey-patching in electron build
Summary:
In D39311893 (094c5bdfdd) we started monkey-patching `require` to resolve global dependencies in the plugins. Apparently, patching `globalThis.require` did not work in the electron env. On my local machine it kept working because I had the experimental `flipper-server` feature enabled which embeds flipper-server into the electron build. In flipper-server we properly patch `require` via `Module.prototype.require` which affected the global require in electron.
With this fix we now properly patch require in electron via Module.prototype.require all the time

Changelog: Fix plugin loading with experimental flipper-server disabled

Reviewed By: nikoant

Differential Revision: D39633821

fbshipit-source-id: 9554f643c625620d116075ae87f573d8447850f6
2022-09-20 01:36:56 -07:00
Andrey Goncharov
9fc9d6f9b5 Remove redundant exports from 'flipper'
Summary: Prevent getRenderHostInstance leaking into 'flipper' types

Reviewed By: lblasa

Differential Revision: D39574678

fbshipit-source-id: 43932d73fed8b37a2a0791a312ee3d5129a4923f
2022-09-16 06:33:18 -07:00
Andrey Goncharov
fab4ee8c22 Unload stale modules from electron cache
Summary: `requirePlugin` in electron uses native `require` which has a built-in cache. Without this fix a stale version of the plugin loaded.

Reviewed By: lblasa

Differential Revision: D39542121

fbshipit-source-id: e6c4b65f9ea7b816803baaae537c234914fcb3d7
2022-09-15 10:02:19 -07:00
Andrey Goncharov
6b3298a29e Reload plugins with updated sources
Reviewed By: lblasa

Differential Revision: D39540173

fbshipit-source-id: 65f5d0f0a325d6ca3ed5e1213e689490c6b650b2
2022-09-15 10:02:19 -07:00
Andrey Goncharov
094c5bdfdd Provide external modules to plugins
Summary: esbuild references external modules via `require`. We wrap `require` to point the references to built-in modules to global variables

Reviewed By: lblasa

Differential Revision: D39311893

fbshipit-source-id: a99480161c082f4095d78c22271f114532f32c16
2022-09-15 10:02:19 -07:00
Andrey Goncharov
650ff4bcfb Remove plugin bundling
Summary: Remove the notion of bundled plugins

Reviewed By: lblasa

Differential Revision: D39308888

fbshipit-source-id: aa88ddbf2801ad1da95f89e4c761259b697b0d66
2022-09-15 10:02:19 -07:00
Andrey Goncharov
642a3ebf81 Remove default plugin entrypoints for hot-reloading
Summary: As we stopped bundling plugins in D39276249, we no longer need the entry points for the bundled plugins (these entry points are always going to be empty)

Reviewed By: lblasa

Differential Revision: D39307565

fbshipit-source-id: 43751fe31c8bd962677c226b27cfe52093d3f2d4
2022-09-15 10:02:19 -07:00
Andrey Goncharov
a888e6affa Simplify bundled plugin setup
Summary: Stop bundling plugins into Flipper Server bundles. In later diffs, we will start building all plugins even in dev mode which removes the need to bundle them.

Reviewed By: lblasa

Differential Revision: D39276249

fbshipit-source-id: 091405cfcf58aa7e1bd2b382da40f8d9841ae6b1
2022-09-15 10:02:19 -07:00