Commit Graph

8255 Commits

Author SHA1 Message Date
Lorenzo Blasa
353e51e2ea Better error message format
Summary:
The existing error message was not in the centre and didn't give any possible remediation steps.

{F1015240268}

Reviewed By: passy

Differential Revision: D46394149

fbshipit-source-id: 09d450bef9df83c5b3af3ba49c7e0fafb81bfdce
2023-06-02 09:35:32 -07:00
Lorenzo Blasa
80c201b10f Add localhost as a valid host
Summary: ^

Reviewed By: passy

Differential Revision: D46393661

fbshipit-source-id: eeaa0971a747d6435a10c3eb27969bb452cd73a7
2023-06-02 09:35:32 -07:00
Andrey Goncharov
e8e1a32e48 Back out "Update adbkit and logcat to maintained librarys"
Summary:
Original commit changeset: 2a23c0eaa12f

Original Phabricator Diff: D45569652

The new lib causes weird log parsing https://fb.workplace.com/groups/flippersupport/permalink/1629943924152926/

Reviewed By: LukeDefeo, passy

Differential Revision: D46390961

fbshipit-source-id: 7c9d0ca7fff2d9cb1ac1a309710f2348233a3471
2023-06-02 08:10:47 -07:00
Lorenzo Blasa
bb9793019c Expand PATH with /usr/local/bin
Summary:
^

There is an issue whereas when Flipper Server is launched NOT from the terminal, it doesn't inherit the user's terminal `$PATH` variable.

This causes a few different issues.

This change tries to address that.

Reviewed By: passy

Differential Revision: D46392435

fbshipit-source-id: 6201a1749134db8c50eca8751af149737dce57d7
2023-06-02 08:01:51 -07:00
Lorenzo Blasa
828d56f617 Kill PortForwardingApp on exit
Summary:
I noticed we were not killing the PortForwardingApp on exit.

This is not ideal.

So, use an exit hook to kill the app.

Reviewed By: passy

Differential Revision: D46392855

fbshipit-source-id: e2b75f76c9dfab0ff46df3ad2c94a1a523154b2a
2023-06-02 07:55:56 -07:00
Anton Kastritskiy
c01b6b9f16 expose isHeadlessBuild to flipper plugins
Reviewed By: passy

Differential Revision: D46364476

fbshipit-source-id: bad584e3892cc0fb0fdaba0e8b3c79952596d34d
2023-06-02 06:49:49 -07:00
Lorenzo Blasa
2f9e633fad Medium refactoring
Summary:
Simplifies medium usage. Clients report this value as an integer. Internally, we transform this integer as type (a set of valid strings).

Instead of transform this value in different places, do it once when the client query is received.

Reviewed By: antonk52

Differential Revision: D46358024

fbshipit-source-id: ecd2b6c6ccbe7c38787a89d4e2f81930c7b91864
2023-06-02 03:59:15 -07:00
github-actions[bot]
3607b7f996 Automated: Update Podfile.lock (#4794)
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/4794

Reviewed By: antonk52

Differential Revision: D46355046

Pulled By: passy

fbshipit-source-id: e676d4c9d8bef0b3ab29bc9e6cb23838b262c5bf
2023-06-01 10:50:02 -07:00
dependabot[bot]
ab62cfa5da Bump indicatif from 0.17.3 to 0.17.4 in /packer (#4778)
Summary:
Bumps [indicatif](https://github.com/console-rs/indicatif) from 0.17.3 to 0.17.4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/console-rs/indicatif/releases">indicatif's releases</a>.</em></p>
<blockquote>
<h2>0.17.4</h2>
<p>Another small bugfix release.</p>
<ul>
<li>Handle newline in msg and empty msg (<a href="https://redirect.github.com/console-rs/indicatif/issues/540">https://github.com/facebook/flipper/issues/540</a>, thanks to <a href="https://github.com/RDruon"><code>@​RDruon</code></a>)</li>
<li>Handle terminal line wrap to avoid new line (<a href="https://redirect.github.com/console-rs/indicatif/issues/533">https://github.com/facebook/flipper/issues/533</a>, thanks to <a href="https://github.com/RDruon"><code>@​RDruon</code></a>)</li>
<li>Resetting the elapsed time also resets ETA (<a href="https://redirect.github.com/console-rs/indicatif/issues/538">https://github.com/facebook/flipper/issues/538</a>, thanks to <a href="https://github.com/afontenot"><code>@​afontenot</code></a>)</li>
<li>Mention the prefix and message placeholders in the <code>with_</code> docs (<a href="https://redirect.github.com/console-rs/indicatif/issues/529">https://github.com/facebook/flipper/issues/529</a>, thanks to <a href="https://github.com/lnicola"><code>@​lnicola</code></a>)</li>
<li>Allow rate-limiting <code>TermLike</code> targets (<a href="https://redirect.github.com/console-rs/indicatif/issues/526">https://github.com/facebook/flipper/issues/526</a>, thanks to <a href="https://github.com/akx"><code>@​akx</code></a>)</li>
<li>Fix docs for <code>ProgressDrawTarget</code> (<a href="https://redirect.github.com/console-rs/indicatif/issues/523">https://github.com/facebook/flipper/issues/523</a>, thanks to <a href="https://github.com/tillarnold"><code>@​tillarnold</code></a>)</li>
<li>Change &quot;OS X&quot; to &quot;macOS&quot; (<a href="https://redirect.github.com/console-rs/indicatif/issues/519">https://github.com/facebook/flipper/issues/519</a>, thanks to <a href="https://github.com/atouchet"><code>@​atouchet</code></a>)</li>
<li>Fix <code>MultiProgress</code> alignment handling and migrate from structopt =&gt; clap (<a href="https://redirect.github.com/console-rs/indicatif/issues/516">https://github.com/facebook/flipper/issues/516</a>)</li>
<li>Don't deadlock when double-adding ProgressBar (<a href="https://redirect.github.com/console-rs/indicatif/issues/515">https://github.com/facebook/flipper/issues/515</a>)</li>
<li>Use <code>instant::Instant</code> when compiling to WASM (<a href="https://redirect.github.com/console-rs/indicatif/issues/514">https://github.com/facebook/flipper/issues/514</a>, thanks to <a href="https://github.com/azriel91"><code>@​azriel91</code></a>)</li>
<li>Update portable-atomic requirement from 0.3.15 to 1.0.0 (<a href="https://redirect.github.com/console-rs/indicatif/issues/512">https://github.com/facebook/flipper/issues/512</a>)</li>
<li>Add <code>contents_formatted()</code> method to `InMemoryTerm (<a href="https://redirect.github.com/console-rs/indicatif/issues/531">https://github.com/facebook/flipper/issues/531</a>, thanks to <a href="https://github.com/dfaust"><code>@​dfaust</code></a>)</li>
<li><code>inc()</code> after work in examples (<a href="https://redirect.github.com/console-rs/indicatif/issues/522">https://github.com/facebook/flipper/issues/522</a>, thanks to <a href="https://github.com/tatref"><code>@​tatref</code></a>)</li>
</ul>
<p>On behalf of the indicatif team (<a href="https://github.com/chris-laplante"><code>@​chris-laplante</code></a> and <a href="https://github.com/djc"><code>@​djc</code></a>), thanks to all contributors!</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="6cc3814f80"><code>6cc3814</code></a> Bump CI MSRV to 1.62.1 to resolve Cargo metadata for vte</li>
<li><a href="7c9465b75b"><code>7c9465b</code></a> Bump version to 0.17.4</li>
<li><a href="5dc966c309"><code>5dc966c</code></a> Bump clap dependency to 4</li>
<li><a href="577a34544a"><code>577a345</code></a> Only check library target against MSRV</li>
<li><a href="9deb9ebe52"><code>9deb9eb</code></a> Add <code>contents_formatted</code> to <code>InMemoryTerm</code></li>
<li><a href="e0494e48c2"><code>e0494e4</code></a> fix: inc after work</li>
<li><a href="59cd60674c"><code>59cd606</code></a> Handle newline in msg and empty msg</li>
<li><a href="6d31845d22"><code>6d31845</code></a> resetting the elapsed time also resets ETA</li>
<li><a href="3d5dbb394b"><code>3d5dbb3</code></a> Add render tests</li>
<li><a href="66a90a660c"><code>66a90a6</code></a> Handle MultiProgress println</li>
<li>Additional commits viewable in <a href="https://github.com/console-rs/indicatif/compare/0.17.3...0.17.4">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=indicatif&package-manager=cargo&previous-version=0.17.3&new-version=0.17.4)](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/4778

Reviewed By: antonk52

Differential Revision: D46355080

Pulled By: passy

fbshipit-source-id: 40a1217d45731b8ea10a532a556c2d51e458fe67
2023-06-01 10:35:15 -07:00
dependabot[bot]
4bf4be9558 Bump react-native-flipper from 0.190.0 to 0.192.0 in /react-native/ReactNativeFlipperExample (#4792)
Summary:
Bumps [react-native-flipper](https://github.com/facebook/flipper) from 0.190.0 to 0.192.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/facebook/flipper/releases">react-native-flipper's releases</a>.</em></p>
<blockquote>
<h2>v0.192.0</h2>
<p>See <a href="https://github.com/facebook/flipper/blob/main/desktop/static/CHANGELOG.md">https://github.com/facebook/flipper/blob/main/desktop/static/CHANGELOG.md</a>
for full notes.</p>
<h2>v0.191.1</h2>
<p>See <a href="https://github.com/facebook/flipper/blob/main/desktop/static/CHANGELOG.md">https://github.com/facebook/flipper/blob/main/desktop/static/CHANGELOG.md</a>
for full notes.</p>
<h2>v0.191.0</h2>
<p>See <a href="https://github.com/facebook/flipper/blob/main/desktop/static/CHANGELOG.md">https://github.com/facebook/flipper/blob/main/desktop/static/CHANGELOG.md</a>
for full notes.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="abcfbd822c"><code>abcfbd8</code></a> Flipper Release: v0.192.0</li>
<li><a href="49c356059a"><code>49c3560</code></a> Use a direct download from Node distribution instead of relying on pkg-fetch</li>
<li><a href="1d595862b5"><code>1d59586</code></a> Fix e2e test</li>
<li><a href="5ca9107d0c"><code>5ca9107</code></a> Expose SKIP_TOKEN_VERIFICATION to frontend</li>
<li><a href="53a5939d68"><code>53a5939</code></a> Add one more fallback for the adb path</li>
<li><a href="ff6b0043c4"><code>ff6b004</code></a> avoid creating a copy of an array of entire view to look up index</li>
<li><a href="230c31b548"><code>230c31b</code></a> Upgrade ts-node (<a href="https://redirect.github.com/facebook/flipper/issues/4771">https://github.com/facebook/flipper/issues/4771</a>)</li>
<li><a href="6c84732742"><code>6c84732</code></a> extract get view index into data source view method</li>
<li><a href="27909e8296"><code>27909e8</code></a> Track CSR processing</li>
<li><a href="f25591580c"><code>f255915</code></a> Track insecure connection attempts</li>
<li>Additional commits viewable in <a href="https://github.com/facebook/flipper/compare/v0.190.0...v0.192.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=react-native-flipper&package-manager=npm_and_yarn&previous-version=0.190.0&new-version=0.192.0)](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/4792

Reviewed By: antonk52

Differential Revision: D46355053

Pulled By: passy

fbshipit-source-id: 9bee3337e0753cde3c43be0b5374a06cdb5b0cc1
2023-06-01 10:25:51 -07:00
dependabot[bot]
8bdaca636e Bump com.google.protobuf:protobuf-java from 3.23.1 to 3.23.2 (#4779)
Summary:
Bumps [com.google.protobuf:protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.23.1 to 3.23.2.
<details>
<summary>Commits</summary>
<ul>
<li><a href="a74f54b724"><code>a74f54b</code></a> Updating version.json and repo version numbers to: 23.2</li>
<li><a href="45ddc11b50"><code>45ddc11</code></a> Update upb dependency (<a href="https://redirect.github.com/protocolbuffers/protobuf/issues/12907">#12907</a>)</li>
<li><a href="91e5e6e76d"><code>91e5e6e</code></a> Merge pull request <a href="https://redirect.github.com/protocolbuffers/protobuf/issues/12906">#12906</a> from mkruskal-google/java-fix-23</li>
<li><a href="b556b8871c"><code>b556b88</code></a> Automated rollback of commit 4d76f12a82bc53cc2d846e65dd8c4bce6c1d4645.</li>
<li><a href="ab367ad73d"><code>ab367ad</code></a> Merge pull request <a href="https://redirect.github.com/protocolbuffers/protobuf/issues/12852">#12852</a> from fowles/23.x</li>
<li><a href="5bc7e02036"><code>5bc7e02</code></a> fix missing int32_t (<a href="https://redirect.github.com/protocolbuffers/protobuf/issues/12554">#12554</a>)</li>
<li><a href="a171d20df3"><code>a171d20</code></a> Merge pull request <a href="https://redirect.github.com/protocolbuffers/protobuf/issues/12845">#12845</a> from protocolbuffers/23.x-202305171614</li>
<li><a href="3cda141b4d"><code>3cda141</code></a> Updating version.json to: 23.2-dev</li>
<li>See full diff in <a href="https://github.com/protocolbuffers/protobuf/compare/v3.23.1...v3.23.2">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.google.protobuf:protobuf-java&package-manager=gradle&previous-version=3.23.1&new-version=3.23.2)](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/4779

Reviewed By: antonk52

Differential Revision: D46355076

Pulled By: passy

fbshipit-source-id: 72e493ea24b11a00d5fec978489d78fc048bc9de
2023-06-01 10:16:48 -07:00
Carlos Moreno
b3850c75c7 Update setup.mdx (#4789)
Summary:
Adding missing semicolon.

Added a missing semicolon in java code.

## Changelog
Update documentation.

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

Test Plan: Does not require a test plan.

Reviewed By: antonk52

Differential Revision: D46355062

Pulled By: passy

fbshipit-source-id: 20c398018b1d2deffb9b1a755d2c5a1543e48c21
2023-06-01 07:05:55 -07:00
Anton Kastritskiy
12734d6b7e allow column filter to be loose
Summary:
Until now when we filter by a column value we only get the items that match this value exactly.

Release: we can add loose filters that match value or `undefined`

Reviewed By: lblasa, ivanmisuno

Differential Revision: D46318631

fbshipit-source-id: 94ecb3f074674d4b0ce3a480f4f3b9ddc058ceef
2023-06-01 06:51:41 -07:00
Olivier Chalouhi
f44b168013 Add settings icon to flipper
Summary: Added a new icon to flipper

Differential Revision: D46243405

fbshipit-source-id: a6cde805a0ef2b006eb88ec5e4e79b6c4925facd
2023-05-31 15:49:24 -07:00
Lorenzo Blasa
6430403da0 Jest update v26.6.3 -> v29.5.1
Summary:
^

Basically, update Jest and fix any raised issues. Mainly:
- Update necessary dependencies
- Update snapshots
- `useFakeTimers` caused a few issues which meant that the way we hook into the performance object had to be tweaked. The main code change is: `//fbsource/xplat/sonar/desktop/scripts/jest-setup-after.tsx`
- `mocked` -> `jest.mocked`

Changelog: Update Jest to v29.5.1

Reviewed By: antonk52

Differential Revision: D46319818

fbshipit-source-id: d218ca8f7e43abac6b00844953ddeb7f4e1010a2
2023-05-31 14:19:29 -07:00
Andrey Goncharov
94cb8935b2 Fix adb connection
Summary: On my mac localhost resolves to an IP6 address by the new adb lib. This should fix it.

Reviewed By: LukeDefeo

Differential Revision: D46314612

fbshipit-source-id: 3771efd2c6b79fe9ae9851ce4aac35bcede28847
2023-05-31 09:25:55 -07:00
generatedunixname89002005306973
e7a180b90c Flipper Snapshot Bump: v0.192.1-SNAPSHOT
Summary: Releasing snapshot version 0.192.1-SNAPSHOT

Reviewed By: lblasa

Differential Revision: D46309560

fbshipit-source-id: 69a76310b639701f3c8e2c25c1b7a2f3ce988deb
2023-05-31 03:54:24 -07:00
generatedunixname89002005306973
abcfbd822c Flipper Release: v0.192.0
Summary: Releasing version 0.192.0

Reviewed By: lblasa

Differential Revision: D46309559

fbshipit-source-id: 94bb3a17dde4554ce903cb8c8d01b0c241ad2976
2023-05-31 03:54:24 -07:00
Lorenzo Blasa
49c356059a Use a direct download from Node distribution instead of relying on pkg-fetch
Summary:
It seems the available binary for macOS arm64 is not signed:

```
codesign -dv --verbose=4 ./node-v16.16.0-macos-arm64
./node-v16.16.0-macos-arm64: code object is not signed
```

This is an issue as it crashes for our flipper server releases.

This can be compared to a binary downloaded from the Node distribution page:

```
codesign -dv --verbose=4 ./node
    Executable=/Users/realpassy/Downloads/node-v16.15.0-darwin-arm64/bin/node
    Identifier=node
    Format=Mach-O thin (arm64)
    CodeDirectory v=20500 size=597360 flags=0x10000(runtime) hashes=18657+7 location=embedded
    VersionPlatform=1
    VersionMin=720896
    VersionSDK=721152
    Hash type=sha256 size=32
    CandidateCDHash sha256=31cdf84cac42a622c1a68558376700a2dd12d40d
    CandidateCDHashFull sha256=31cdf84cac42a622c1a68558376700a2dd12d40d81c5118f3b0e0370c414eb69
    Hash choices=sha256
 CMSDigest=31cdf84cac42a622c1a68558376700a2dd12d40d81c5118f3b0e0370c414eb69
    CMSDigestType=2
    Executable Segment base=0
    Executable Segment limit=56082432
    Executable Segment flags=0x1
    Page size=4096
    Launch Constraints:
        None
    CDHash=31cdf84cac42a622c1a68558376700a2dd12d40d
    Signature size=8986
    Authority=Developer ID Application: Node.js Foundation (HX7739G8FX)
    Authority=Developer ID Certification Authority
    Authority=Apple Root CA
    Timestamp=26 Apr 2022 at 23:00:57
    Info.plist=not bound
    TeamIdentifier=HX7739G8FX
    Runtime Version=11.1.0
    Sealed Resources=none
    Internal requirements count=1 size=164
```

For additional context:

Node binary by using pkg-fetch. We just get the binary from this release page: https://github.com/vercel/pkg-fetch/releases/tag/v3.4

The exact binary we're downloading is https://github.com/vercel/pkg-fetch/releases/download/v3.4/node-v16.15.0-macos-arm64

If you just download that via Chrome, it will trigger Gatekeeper and you need to manually click "Allow" in the system privacy settings. You can also do the same by just running:

    xattr -c ./node-v16*

Afterwards you can:
   chmod +x ./node*

It will crash in the same way that it does after our distribution.

Reviewed By: passy

Differential Revision: D46225503

fbshipit-source-id: f0ae2d5101b99c9db7fe80333573caef52c787a2
2023-05-31 01:06:17 -07:00
Andrey Goncharov
1d595862b5 Fix e2e test
Summary: This time for real

Reviewed By: elboman

Differential Revision: D46279935

fbshipit-source-id: a639a6abafa7267ef4539c183323a5c96674e202
2023-05-30 09:47:19 -07:00
Andrey Goncharov
5ca9107d0c Expose SKIP_TOKEN_VERIFICATION to frontend
Summary: It is hard to pass auth token to Jest E2E tests.

Reviewed By: lblasa

Differential Revision: D46279204

fbshipit-source-id: ee0138c3bd014bafb416f7fa8951fb25b25b4067
2023-05-30 09:47:19 -07:00
Andrey Goncharov
53a5939d68 Add one more fallback for the adb path
Summary: It seems that adb path has changed on the jest-e2e side. That might case the flipper e2e test failure. With this fallback we have granular control of the path.

Reviewed By: antonk52

Differential Revision: D46278512

fbshipit-source-id: 97310459de54eeb003eefb3a3ff06af8b13bebae
2023-05-30 09:47:19 -07:00
Anton Kastritskiy
ff6b0043c4 avoid creating a copy of an array of entire view to look up index
Summary: What title says

Reviewed By: lblasa

Differential Revision: D46275672

fbshipit-source-id: 65c6566a042b576b83ababdf6470ddf2f626d3e4
2023-05-30 08:01:18 -07:00
Pascal Hartig
230c31b548 Upgrade ts-node (#4771)
Summary:
[js] Upgrade ts-node
Seeing an odd Windows-specific error after upgrading TS. Let's see if this makes
a difference.

https://github.com/facebook/flipper/actions/runs/5081747814/jobs/9130539676

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

Test Plan: Windows is happy again: https://github.com/facebook/flipper/actions/runs/5089519936/jobs/9147247783?pr=4771

Reviewed By: antonk52

Differential Revision: D46220440

Pulled By: passy

fbshipit-source-id: 185ab71409625a1d8db0563fa22da2a459f5e264
2023-05-26 11:55:12 -07:00
Anton Kastritskiy
6c84732742 extract get view index into data source view method
Reviewed By: ivanmisuno

Differential Revision: D46224361

fbshipit-source-id: 193becb59eee469ba3e68611e588671947406f7e
2023-05-26 11:55:11 -07:00
Lorenzo Blasa
27909e8296 Track CSR processing
Summary:
Need to answer:

- Certificate exchange success rate, fails and errors a day per OS and device type.

Reviewed By: antonk52

Differential Revision: D46221301

fbshipit-source-id: 03c6993aa15f56fdf98a7abd57d00b2af0e9ce1a
2023-05-26 08:02:12 -07:00
Lorenzo Blasa
f25591580c Track insecure connection attempts
Summary: Same as previous diff but for plain socket.

Reviewed By: antonk52

Differential Revision: D46220933

fbshipit-source-id: 235ca860891b8514dd0d743d32fe85f15a2cdd7e
2023-05-26 08:02:12 -07:00
Lorenzo Blasa
135d3e3aa8 Track secure connection attempts
Summary: Same as previous diff but for TLS attempts.

Reviewed By: antonk52

Differential Revision: D46220897

fbshipit-source-id: 9495c39edffbdebe0ba21ec7320b63bad8759dde
2023-05-26 08:02:12 -07:00
Lorenzo Blasa
8065313949 Track app connections
Summary:
Need to answer:

- How many app connections a day/week?
- How many connections a day/week per app?
- How many connections a day/week per os?
- How many connections a day/week over WWW exchange?
- How many connections a day/week over FS exchange?
- How many connections over a device?
- How many connections over a simulator?

Reviewed By: antonk52

Differential Revision: D46220581

fbshipit-source-id: 6783f49b59cba91cd04625044314973d98cef301
2023-05-26 08:02:12 -07:00
Lorenzo Blasa
e7806d5be7 Track server start
Summary:
Need to answer:

- How many starts a day over time

Reviewed By: antonk52

Differential Revision: D46219995

fbshipit-source-id: bffaeadf684a2d34c6e145784c5a86dbaf5f532a
2023-05-26 08:02:12 -07:00
Lorenzo Blasa
29510f66c8 Track proxy errors
Summary:
Need to answer:
- Proxy errors rate over time

Reviewed By: antonk52

Differential Revision: D46219927

fbshipit-source-id: 1ad8cc60303ed3aa34828b9ff87009ff7754a146
2023-05-26 08:02:12 -07:00
Lorenzo Blasa
6936cb34ac Track socket already in use
Summary:
Some times the socket can already be in use by an existing process. Track it as to quantify how likely this is found in production. May remove later.

Need to answer:
- Socket already in use rate over time

Reviewed By: antonk52

Differential Revision: D46219768

fbshipit-source-id: 27da82cddb707f729a1d43079e84c221bb544a82
2023-05-26 08:02:12 -07:00
Lorenzo Blasa
694f6f284e Define a tracker interface and replace auth token tracking
Summary:
Define the tracker interface and replace the existing authentication token verification tracking.

Subsequent diffs will add analytics for remaining connectivity areas.

Need to answer:
- No tokens rate over time
- Unable to verify tokens rate over time

Reviewed By: antonk52

Differential Revision: D46219661

fbshipit-source-id: dfc41cae664bc1ef211d312990120111fca3808b
2023-05-26 08:02:12 -07:00
Joshua May
8aed5cfb9c Ignore Brotli decode result on 0-length return value (#4632)
Summary:
Brotli response decoding was introduced via https://github.com/facebook/flipper/pull/4288, and released in 0.177.0. We noticed from that release that many of our iOS response bodies were not being rendered. It simply showed `(empty)` in the `Response Body` section.

As noted in the gzip decoder ([here](2a52656d0b/desktop/plugins/public/network/utils.tsx (L117-L119))) within Flipper, iOS already provides an inflated `data` value, so it doesn't need inflating again.

This PR adds a best-effort guess to detect when the same problem arises in the Brotli decoder.

I'm definitely not a Brotli expert, but according to [this SO post](https://stackoverflow.com/questions/39008957/is-there-a-way-to-check-if-a-buffer-is-in-brotli-compressed-format), there's no sure-fire way to detect Brotli data, and some blobs of random data will still present as Brotli. We may still occasionally see false positives that continue to show `(empty)`, however in my testing, all of our server responses have rendered JSON responses perfectly.

The library used for decoding doesn't throw an error on failure with any responses we've seen, it just simply returns a 0-length buffer. So the naïve approach taken in this PR simply looks for a 0-length output buffer on a non-zero-length input buffer, and concludes "probably not Brotli, shrug emoji".

## Changelog

Ignore Brotli decode result on 0-length return value

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

Test Plan:
We can use Facebook's servers to test this. Fire up a RN app, and add the following somewhere you can run it:

```typescript
fetch('https://graph.facebook.com/facebook/picture?redirect=false', {
  headers: {
    'accept-encoding': 'br',
  },
})
```

Before this patch, we can see that `Response Body` is `(empty)` in Flipper:

<img width="1211" alt="Screenshot 2023-03-30 at 1 26 48 am" src="https://user-images.githubusercontent.com/33126/228690254-988b5a01-5d7b-4ab3-b6dc-49f3b0607d10.png">

But after this patch, we can see some valid JSON in the `Response Body`:

<img width="1213" alt="Screenshot 2023-03-30 at 1 26 07 am" src="https://user-images.githubusercontent.com/33126/228690351-9611759a-5b7d-4ccb-9170-22b950c8afbe.png">

Most importantly, both responses have `Content-Encoding: br` headers.

Reviewed By: passy

Differential Revision: D46219337

Pulled By: mweststrate

fbshipit-source-id: 2ae775d381fa325c6d9e543bdbc617d1fd986671
2023-05-26 05:30:33 -07:00
generatedunixname89002005306973
59ddc2ecd1 Flipper Snapshot Bump: v0.191.2-SNAPSHOT
Summary: Releasing snapshot version 0.191.2-SNAPSHOT

Reviewed By: passy

Differential Revision: D46218567

fbshipit-source-id: 081430c028c561eb4e434251a9edac60986e0c3d
2023-05-26 03:00:54 -07:00
generatedunixname89002005306973
9c934325ac Flipper Release: v0.191.1
Summary: Releasing version 0.191.1

Reviewed By: passy

Differential Revision: D46218568

fbshipit-source-id: 11752bdc05d29387966a64980b7a0457fe5173a4
2023-05-26 03:00:54 -07:00
Pascal Hartig
7114b41ee3 Fix test
Summary: Broken here: https://github.com/facebook/flipper/actions/runs/5081747819/jobs/9130539143

Reviewed By: antonk52

Differential Revision: D46189738

fbshipit-source-id: b26da6e6bc2434b4b48962d195f30ab9e18cb6de
2023-05-25 10:13:23 -07:00
Lorenzo Blasa
eaaac54bc4 Manifest as template
Summary:
The file manifest.json is injected with the auth token and it happens with every launch.

Because the file is tracked, these changes will always get picked no matter what the .gitignore file specifies, because is a tracked file.

So, the solution is to have a template with a different name, that gets copied into the right location during build time.

Reviewed By: LukeDefeo

Differential Revision: D46184772

fbshipit-source-id: 938b9433045485d9846a6a50c1c955ebe7925581
2023-05-25 08:21:41 -07:00
Lorenzo Blasa
76fbaf245c Replace existing running instance, if any
Summary:
Replace an existing running instance, if any.

This is useful for:
- Applying updates
- Ensuring freshness of server

Reviewed By: passy

Differential Revision: D46146814

fbshipit-source-id: bfb760f3ab26b7632510773609f1c6ca3a97c4ec
2023-05-25 06:32:18 -07:00
Pascal Hartig
558316153c Build server release for Mac AARCH64
Reviewed By: lblasa

Differential Revision: D46144878

fbshipit-source-id: 1aa2982fc99e5dc6cdfbe4d9fcf87f7fc55a1abe
2023-05-24 10:48:00 -07:00
Pascal Hartig
9b448b2864 Bump Android resources (#4768)
Summary:
Fix the current test failures due to the new JDK requirements.

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

Test Plan:
Hard to dry-run. Best I can offer is the check here using the CircleCI UI:

![Screenshot 2023-05-24 at 11 45 19](https://github.com/facebook/flipper/assets/9906/2197d2cf-b6af-4463-8389-636029e983da)

Reviewed By: ivanmisuno

Differential Revision: D46145533

Pulled By: passy

fbshipit-source-id: 1887b1ffaa813f79d8a2ec9bd9486796399f865a
2023-05-24 09:04:58 -07:00
Pascal Hartig
33aebc7406 Upgrade to indicatif 0.17
Reviewed By: lblasa

Differential Revision: D46148852

fbshipit-source-id: 2a14f87c782829130b1b0b3c923c568e3eaa8d30
2023-05-24 07:34:12 -07:00
Lorenzo Blasa
4704c177ec Check if server is already listening
Summary:
Right now, this simply avoids trying to create a server instance if one appears to be already running.

In a future change, we may decide to kill the existing instance and replace it with a new one.

But, in this case, running this as is will be useful as it will provide the connection URL with the auth token.

Also remove flipper server dependency from finding installation. In this case, we don't need it and can use `os.getPlatform()` instead.

Reviewed By: antonk52

Differential Revision: D46144843

fbshipit-source-id: 2922843b916d37e0126e43ae65a622f87a6920ec
2023-05-24 06:50:05 -07:00
Pascal Hartig
5441494376 Centralise and bump deps (#4759)
Summary:
[android][tutorial] Centralise and bump deps
Per title.

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

Test Plan:
As before.

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4759).
* __->__ https://github.com/facebook/flipper/issues/4759
* https://github.com/facebook/flipper/issues/4758
* https://github.com/facebook/flipper/issues/4757
* https://github.com/facebook/flipper/issues/4756
* https://github.com/facebook/flipper/issues/4755
* https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751

Reviewed By: ivanmisuno

Differential Revision: D46069041

Pulled By: passy

fbshipit-source-id: c970c57e72445faca92a0618ed612ec86eb9f970
2023-05-24 04:19:58 -07:00
Pascal Hartig
0f76995e0c Bump target and compile SDK (#4758)
Summary:
[android] Bump target and compile SDK
Latest and greatest.

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

Test Plan:
As before

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4758).
* https://github.com/facebook/flipper/issues/4759
* __->__ https://github.com/facebook/flipper/issues/4758
* https://github.com/facebook/flipper/issues/4757
* https://github.com/facebook/flipper/issues/4756
* https://github.com/facebook/flipper/issues/4755
* https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751

Reviewed By: ivanmisuno

Differential Revision: D46069036

Pulled By: passy

fbshipit-source-id: 62eb5377ed611afbf42016d91a6929d5ec627fb8
2023-05-24 04:19:58 -07:00
Pascal Hartig
a44d4fac44 Build Tools 33.0.2 (#4757)
Summary:
[android] Build Tools 33.0.2

Bump to latest version. In isolation to check build failures.

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

Test Plan:
Build sample, CI

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4757).
* https://github.com/facebook/flipper/issues/4759
* https://github.com/facebook/flipper/issues/4758
* __->__ https://github.com/facebook/flipper/issues/4757
* https://github.com/facebook/flipper/issues/4756
* https://github.com/facebook/flipper/issues/4755
* https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751

Reviewed By: ivanmisuno

Differential Revision: D46069024

Pulled By: passy

fbshipit-source-id: 4b80d86999c4b39351907fe16b81314f65c06bc2
2023-05-24 04:19:58 -07:00
Pascal Hartig
7a23d6ab20 Copy deprecation note (#4756)
Summary:
[android] Copy deprecation note
Ran the Kotlin migration process. They recommend we carry forwards these warnings.

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

Test Plan:
- CI

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4756).
* https://github.com/facebook/flipper/issues/4759
* https://github.com/facebook/flipper/issues/4758
* https://github.com/facebook/flipper/issues/4757
* __->__ https://github.com/facebook/flipper/issues/4756
* https://github.com/facebook/flipper/issues/4755
* https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751

Reviewed By: ivanmisuno

Differential Revision: D46068989

Pulled By: passy

fbshipit-source-id: 7011939d9a3970376348c5b03e2352719aff3948
2023-05-24 04:19:58 -07:00
Pascal Hartig
56aecba339 Remove unnecessary ndk version indirection (#4755)
Summary:
[android] Remove unnecessary ndk version indirection
The constant was only referenced in one place, the ext property everywhere else.

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

Test Plan:
CI

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4755).
* https://github.com/facebook/flipper/issues/4759
* https://github.com/facebook/flipper/issues/4758
* https://github.com/facebook/flipper/issues/4757
* https://github.com/facebook/flipper/issues/4756
* __->__ https://github.com/facebook/flipper/issues/4755
* https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751

Reviewed By: ivanmisuno

Differential Revision: D46068954

Pulled By: passy

fbshipit-source-id: 276e4ee3d52a4a21c6dc29c17b6b2bd9968e945b
2023-05-24 04:19:58 -07:00
Pascal Hartig
c3013ae57b Rename no-op package namespace (#4754)
Summary:
[android] Rename no-op package namespace
Shouldn't affect anything but otherwise you get a warning:

```
[:android] /Users/realpassy/Projects/java/flipper/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml Warning:
        Namespace 'com.facebook.flipper' used in: :android, com.facebook.flipper:flipper:0.182.0.
```

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

Test Plan:
CI
Build sample

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/4754).
* https://github.com/facebook/flipper/issues/4759
* https://github.com/facebook/flipper/issues/4758
* https://github.com/facebook/flipper/issues/4757
* https://github.com/facebook/flipper/issues/4756
* https://github.com/facebook/flipper/issues/4755
* __->__ https://github.com/facebook/flipper/issues/4754
* https://github.com/facebook/flipper/issues/4753
* https://github.com/facebook/flipper/issues/4752
* https://github.com/facebook/flipper/issues/4751

Reviewed By: ivanmisuno

Differential Revision: D46068943

Pulled By: passy

fbshipit-source-id: ac806cd1c8444875fe965c95095ba886592e72d0
2023-05-24 04:19:58 -07:00
Pascal Hartig
a711a578b1 Add build target for M1 mac
Summary: We didn't define the build for aarch64 locally previously, so packer didn't know how to bundle it up. Since it shares the layout of x64, we will also save on CDN resources because it will automatically get deduplicated.

Reviewed By: lblasa, antonk52

Differential Revision: D46144879

fbshipit-source-id: 20087010db02d3965ed0c5d4add72e0b19849d13
2023-05-24 04:13:07 -07:00