Summary: The "attaching failed" error provides no context and is a handled error, so we don't need to elevate this to a warning. We also see a socket warning on stderr every time we start up logging through simctl, so we don't need to treat that as an error.
Reviewed By: nikoant
Differential Revision: D26228037
fbshipit-source-id: 1938dadd54499462e1fd614c9477f738661c387b
Summary:
VSCode got a new thing where it doesn't save my file because it waits for a formatter or some stuff indefinitely, which is really cool, because it means my diffs end up being incomplete.
So this should have been in D26223274 (642d89213d) but now it's here.
angry_cry
Reviewed By: nikoant
Differential Revision: D26228038
fbshipit-source-id: 98b84179dce4e8e8c71f9196ab78d534327ea301
Summary:
Just some simple memoisation so we limit this particular `remote`
call to one per session.
Reviewed By: mweststrate
Differential Revision: D26223274
fbshipit-source-id: 7a12764758823c52f68fb7075f46caf58affb22f
Summary: Crash reporter generated React errors because the different lines in a stack trace are not per definition unique
Reviewed By: jknoxville
Differential Revision: D26201941
fbshipit-source-id: 084e0157b1fa3b8216d35f62f0dc17b0d6414b8e
Summary:
This diff adds gk checks, VPN check and User login check to our plugin.
I added gk checks for Insta and FB apps. There are three kind of GK's. One with FB universe, one with Distillery universe and one with Insta WWW universe. We have API's to check gk with FB and Distillery universe. API to check with Insta WWW universe doesn't exists. There are some technical challenges to build this API. So right now for gks with Insta WWW universe, we just show an notification with info icon. For gks in other universe we aggressively check it when user closes the notif to verify if user assigned himself/herself to it.
In long term we are moving away from gks altogether, we need this UX improvement as it will help users to onboard easily.
See the following flow.
Reviewed By: mweststrate
Differential Revision: D26176996
fbshipit-source-id: 92a931610f9b244c14c6888bb12df936b62edd75
Summary:
These are recoverable, handled errors. We shouldn't treat these
as events that require actions from us. They also have
a tendency of firing a lot.
Reviewed By: nikoant
Differential Revision: D26202358
fbshipit-source-id: 445f3c2bcd0041d5cd773ec04172fdeed9b32222
Summary:
It had this scary warning at the top that the TS version was
too new for the linters.
Reviewed By: nikoant
Differential Revision: D26202273
fbshipit-source-id: df03d6bf176da00ee37b027679b9f258ab123395
Summary: Update the binary for Linux. Took me *a freaking hour* to build. I need an M1 Mac.
Reviewed By: mweststrate
Differential Revision: D26197862
fbshipit-source-id: e5a593743d239598bab1c8f29a778a49e17afcf8
Summary: Recent versions of stack added this. Probably a good idea to commit this.
Reviewed By: nikoant
Differential Revision: D26174669
fbshipit-source-id: eaad59f81aa5cdb6cdd456029f1f176b458cac28
Summary: This is the new Mac artifact based on what's in the code. Still building the Linux one.,
Reviewed By: nikoant
Differential Revision: D26174670
fbshipit-source-id: a5364b45bcc8d6325a698633d0e1a076ef1080ad
Summary:
Note: Binary update will follow as separate diff.
Noticed that these weren't updated automatically.
Reviewed By: mweststrate
Differential Revision: D26150738
fbshipit-source-id: 05583a3d8c6425d41e985255e0281a90e5062dad
Summary:
Using our serialization utilities in the previous diff absolute destroyed the performance of serializing the device logs. Investigated a bit, and the root cause is that *every* object serialization would notify the UI.
This is not only pointless, since the UI won't be updated until the next tick anyway, it also is terribly expensive since React has to process and queue all these updates.
Exporting the device logs went down from **2 minutes to a few seconds** with this change. (Still a lot slower than JSON.stringify, but I think the flexibility for plugin devs is worth it).
This change does not only benefit devicelogs plugin, but all existing plugins as well, plugins like GraphQL should now export their data much quicker.
Before (practically all time of serialization is spend in React's setState):
{F366147730}
After (only a spike at the end of the idler tick):
{F366147779}
Reviewed By: priteshrnandgaonkar
Differential Revision: D26146420
fbshipit-source-id: 9bbeccf04701fd044e041956b7bb00f1e0622b63
Summary:
Unlike non-sandy plugins, non-sandy plugins weren't serialized using our serialization utility yet. This diff addresses that, meaning that users don't have to bother about how to serialize maps, sets and dates.
Unlike the old fashioned plugins, the `makeObjectSerialize` utility is used, rather than `serialize`. This normalizes the objects, but doesn't serialize them, which is done at the end of the export data process anyway for the whole tree. This avoids creating a double JSON serialization which is fully of ugly escape characters.
This makes the onImport / onExport definition of the logs plugin nicer.
Also improved the docs.
Reviewed By: nikoant
Differential Revision: D26146421
fbshipit-source-id: 6abfb6ee2e3312e2a13a11832ff103dc62fd844c
Summary:
While creating some other tests, discovered that our current date serialization uses `toString()` serialization, causing the amount of milliseconds to be lost. The serialization (see below) uses less bytes as well since the human readable timezone isn't included. This change only affects serialization and is backward compatible.
```
✓ test serialize and deserializeObject function for non Object input (1 ms)
✕ test makeObjectSerializable and deserializeObject function for Date input (2 ms)
✓ test makeObjectSerializable and deserializeObject function for Map of Sets
✓ test makeObjectSerializable and deserializeObject function for Map, Dates and Set with complex nesting (1 ms)
● test makeObjectSerializable and deserializeObject function for Date input
expect(received).toEqual(expected) // deep equality
Expected: 2021-03-01T10:31:07.205Z
Received: 2021-03-01T10:31:07.000Z
```
Reviewed By: priteshrnandgaonkar
Differential Revision: D26145941
fbshipit-source-id: dfd6607a4199ca46e2075027856138efb88a07f9
Summary:
Logs were stored hardcoded on the Device object first, this diff makes it normal plugin state.
This makes sure that we can use the same abstractions as in all plugins that store large data sets, and that we can leverage the upcoming DataSource abstraction.
Reviewed By: nikoant
Differential Revision: D26127243
fbshipit-source-id: 7c386a615fa7989f35ba0df5b7c1d218d37b57a2
Summary: Per title, this allows for pre-processing data after it is deserialized and before it is stored in the plugin
Reviewed By: nikoant
Differential Revision: D26126423
fbshipit-source-id: bc08a6ab205d2a0d551515563cd85a197595ddb2
Summary:
Sandy plugins can now set up an `onExport` handler to enable customizing the export format of a plugin: `client.onExport(callback: (idler, onStatusMessage) => Promise<state>)`
Import will be done in next diff
Reviewed By: nikoant
Differential Revision: D26124440
fbshipit-source-id: c787c79d929aa8fb484f15a9340d7c87545793cb
Summary: Sandy device plugins weren't exported till now (the only stateful plugin so far was Logs, but logs were stored hardcoded on the device rather than using the plugin export mechanisms). This diff makes sure that SandyDevicePlugins will be exported as well if they are persistable.
Reviewed By: nikoant
Differential Revision: D22724822
fbshipit-source-id: a10354a9c7e02f3e696d0cdda0f2c6be6f5ac61e
Summary:
While trying to change something, discovered we have 3 different mechanisms in our code base to compute active plugins; the plugin list component, support form, and export flipper trace form had all their own, subtly different implementations of computing which plugins are available to the user.
Also removed some hardcoded exceptions for e.g. Logs plugin, which in the next diff and onward will be just a vanilla plugin without special casing
Unified that, which some how went a bit deeper than hoped, trough some hoops in in circular deps. Also unified to use the same testing utils, to avoid some gobbling objects manually together, with resulted in a bunch of unexpected NPEs. Found out that we actually still have unit tests using Flow in the process :-P. Converted one to TS.
Reviewed By: nikoant
Differential Revision: D26103172
fbshipit-source-id: 2fce2577d97d98543cb9312b3d013f24faee43aa
Summary:
Provide a more robust technique for exporting the mocks to a file.
The current technique for exporting mocks to a file seems to fail under some scenarios. The correct format is an array of objects:
```
[
{
"requestUrl": "https://api.github.com/repos/facebook/yoga",
"requestMethod": "GET",
```
However, the following format is sometimes exported instead:
```
{
"10": {
"requestUrl": "https://demo9512366.mockable.io/SonarPost",
```
Using `Object.values` provides a more robust technique that has been successful during subsequent testing.
## Changelog
Network Plugin - new technique for exporting mocks
Pull Request resolved: https://github.com/facebook/flipper/pull/1872
Test Plan:
Create mocks in the network plugin
Export mocks
Manually examine file for correct format
Import mocks and verify that the file has been imported correctly
Reviewed By: nikoant
Differential Revision: D26172954
Pulled By: mweststrate
fbshipit-source-id: bdfa3ba7dfe656f30ef17df001fc83dd8ea18ece
Summary:
- Made `EnumMapping` support generic value type - `ImageView.ScaleType` is a Java enum; the scaleType api uses this instead of int types.
- Introduce descriptor for `ImageView` and allow getting/setting scaleType.
Reviewed By: mweststrate
Differential Revision: D26092725
fbshipit-source-id: ea3a4ee036b2b808f14277387d360318b7d25824
Summary:
Bumps [types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 7.2.7 to 7.4.0.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Pull Request resolved: https://github.com/facebook/flipper/pull/1869
Reviewed By: mweststrate
Differential Revision: D26149508
Pulled By: passy
fbshipit-source-id: 6bc9360d297bb9285e3c7515b4731f5c3478c97b
Summary:
Continue with cleanup of Network plugin mock screens. This mostly consists of replacing FlexColumn, FlexRow and FlexBox with equivalent Sandy components.
Here is the new screen:
- replace text buttons with Button
- add NUX info to "Copy Highlighted Calls" button
- add message when no calls have been highlighted
- in routes list remove padding on line items

Here is the prior screen:

## Changelog
Network Plugin - Additional cleanup of UI on mock screen
Pull Request resolved: https://github.com/facebook/flipper/pull/1873
Test Plan:
Create and modify mocks
Verify that the functionality has not been affected by UI changes
Reviewed By: passy
Differential Revision: D26172915
Pulled By: mweststrate
fbshipit-source-id: f0af143d8509b53585076737832657fb095e75a6
Summary:
Used this to find out that my 0.10 release was borked but this one works.
This doesn't require any code changes because we're already using the
equivalent of 0.10.1 internally through the mono repo.
Changelog: Update to SoLoader 0.10.1
Reviewed By: nikoant
Differential Revision: D26148652
fbshipit-source-id: 7d8c2bc8d8dfaca7118d240bd365be08948e4623
Summary:
Made UI fixes to Network Plugin (mostly to Route screens) to continue migration to the new design framework. This consisted mostly of replacing FlexColumn and FlexRow with Layout.Container and Layout.Horizontal.
Also, contains some cosmetic changes to "Mock Network Response" page.
Here is the screenshot with UI changes:

This was the old screen for comparison:

## Changelog
Network Plugin - UI changes to continue migration to Sandy design framework
Pull Request resolved: https://github.com/facebook/flipper/pull/1864
Test Plan: Manual testing to ensure that all data still displayed with new UI changes (especially the Data and Headers info in the "Route Info" section)
Reviewed By: passy
Differential Revision: D26125656
Pulled By: mweststrate
fbshipit-source-id: a25104274ed25788e5c0738ac0a9609f2cead751
Summary: Found out about this today.
Reviewed By: mweststrate
Differential Revision: D26129626
fbshipit-source-id: 82aa5d9fa536010b51fc1cf937f521e5ffa88015
Summary: let's make it easier for users to spot possiblity to jump to source code from flipper
Reviewed By: priteshrnandgaonkar
Differential Revision: D26147686
fbshipit-source-id: 6e248c10e73f3b8fcd937d915af6e91db1fe6abe
Summary:
This is an automated PR to update the Podfile.lock.
- Make sure that the Podfile.lock contains latest FlipperKit and Flipper pod versions.
- Also make sure that all the dependencies are updated to the latest one.
- This is auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request)
Pull Request resolved: https://github.com/facebook/flipper/pull/1870
Reviewed By: mweststrate
Differential Revision: D26146167
Pulled By: nikoant
fbshipit-source-id: 3a5c1e8fd7cb5f39d5f96d9a299e54b535736839
Summary: Going to make more changes here soon and wanted to apply some small changes first.
Reviewed By: jknoxville
Differential Revision: D26078645
fbshipit-source-id: 3a2bcd593b893160b5a332c858a514ebe89d3f4d
Summary:
I found a `CFBundleURLTypes` in the .app. Turns out that Munki has
a bunch of hard-to-discover deeplinks: https://github.com/munki/munki/wiki/Munki-Links
Reviewed By: mweststrate
Differential Revision: D26125684
fbshipit-source-id: 3a470360e3df287bd9a07d2e587094cbf7879e33
Summary: Also removed a weird href on a paragraph.
Reviewed By: mweststrate
Differential Revision: D26125630
fbshipit-source-id: b3fab87cf295f8fdbfe142e8c0a32909ce828a57
Summary: Plugin metadata format extended to include type of each plugin (client / device) and list of supported devices (android/ios/..., emulator/physical, etc). This will allow to detect plugins supported by device even if they are not installed and only available on Marketplace.
Reviewed By: mweststrate
Differential Revision: D26073531
fbshipit-source-id: e331f1be1af1046cd4220a286a1d52378c26cc53
Summary: This diff fixes the issue when there is an error on checking GK for any of plugins and because of it the entire set of plugins failed to load. Each plugin should be loaded in isolation from others.
Reviewed By: passy
Differential Revision: D26099735
fbshipit-source-id: ba5475f4baf2d06f8922d345c9d401f5b15956ec
Summary:
This diff keeps the opensource integration of CK for Flipper at the same place. It moves the code which is referred internally to a different folder under Facebook directory.
The reason we are doing this is because, CK won't be publishing any more opensource releases to Cocoapods. Thus we would like to keep the code for opensource compatible to the latest one. Internally we would refer to the CK code from Facebook directory.
Reviewed By: fabiomassimo
Differential Revision: D26047510
fbshipit-source-id: 302890bcd36d3e4c4888577d821433f58fcab5c7
Summary:
In the network plugin, add features to import and export routes as described in issue https://github.com/facebook/flipper/issues/1651
Primary use case is that external testers (such as QA teams) would be able to create test data, convert it to mocks and save the mocks to make bug fixes easier for devs.
Here is a screenshot showing location of buttons to perform import/export (and clearing) of mock routes:

Here is another screenshot showing export dialog:

Changelog: [Network] Mock routes can now be imported and exported. Thanks bizzguy!
Pull Request resolved: https://github.com/facebook/flipper/pull/1855
Test Plan:
Performed manual testing
- create new mocks
- export mocks
- clear mocks
- import mocks
- verify that mocks still work by making GET/POST requests in sample app
Performed various permutations of above manual tests, including restarting Flipper at various points to ensure that test plan still worked. Also performed visual inspection of exported files to verify correctness.
Would be very interested in learning how to create automated tests for this functionality.
Reviewed By: passy
Differential Revision: D26072928
Pulled By: mweststrate
fbshipit-source-id: 51bd5e19e78d830b94add850d5dc9b9e45fa6fad
Summary: importing `antd` in a plugin that lives in the Flipper repo will give a int warning. This fixes that, antd is provided by the host package.
Reviewed By: nikoant
Differential Revision: D26073161
fbshipit-source-id: 897357fafce20129f7e12c035ff99cb4870cc814
Summary:
The support form currently has a search form to select a group, but unless the selection is cleared, it won't show you which groups is actually available, which makes it hard for people to select the right group if they don't know up front.
Since the scale of available groups doesn't justify needing a typeahead, converted it to an ordinary dropdown.
An added benefit is that this allows us to remove a large and complicated component we shouldn't be maintaining ourselves, but rather reuse from Ant.
Reviewed By: nikoant
Differential Revision: D26046131
fbshipit-source-id: f499e5848eec8b961b054104c8e3a01567e2801e