Commit Graph

259 Commits

Author SHA1 Message Date
Anton Kastritskiy
a5c109f762 doctor button
Reviewed By: lblasa

Differential Revision: D47435889

fbshipit-source-id: ff3eef79f50f3b63ada46c6d8349860906e28715
2023-07-18 03:52:34 -07:00
Anton Kastritskiy
5647b9a4b8 start emulator button
Reviewed By: elboman

Differential Revision: D47400275

fbshipit-source-id: 38a0090283e8fc7207b643411246b15a3659616d
2023-07-18 03:52:34 -07:00
Anton Kastritskiy
a7d3c265c6 plugin manager button
Reviewed By: elboman

Differential Revision: D47400185

fbshipit-source-id: fc2875808d8b2c2443766d7619091c65395b0c07
2023-07-18 03:52:34 -07:00
Anton Kastritskiy
5b27a6a4c9 toggle left sidebar button
Reviewed By: elboman

Differential Revision: D47399778

fbshipit-source-id: 842a6900f05e629c4c4fca60928fb9ab107b46fd
2023-07-18 03:52:34 -07:00
Anton Kastritskiy
12997086eb Pretty navbar buttons
Reviewed By: elboman

Differential Revision: D47399039

fbshipit-source-id: c4cc9612a5a9299ebb07e34933b2fa6698f073e7
2023-07-18 03:52:34 -07:00
Anton Kastritskiy
32e19b779f move login button to navbar
Reviewed By: elboman

Differential Revision: D47398401

fbshipit-source-id: 9d49f79e97af5f3373e9c872d9d59e7f9e15694e
2023-07-18 03:52:34 -07:00
Anton Kastritskiy
bdd502d54f navbar placeholder
Reviewed By: elboman

Differential Revision: D47398098

fbshipit-source-id: 6e9518b47292b351153015da233574f7abfd0396
2023-07-18 03:52:34 -07:00
Lorenzo Blasa
fb845a5ae6 Back out "Remove usage of ReactDOM.render for root"
Summary:
Original commit changeset: 2a975690bab0

Original Phabricator Diff: D47257442

For context:
More things need updating and testing. Node, antd, etc. needs all updating.

Once this lands, a new release needs to be made triggered by:
https://www.internalfb.com/chronos/job/gp/27021599065494131

Differential Revision: D47456598

fbshipit-source-id: 1f96e88744b98c7d477c5ccc43167bde475e3036
2023-07-13 18:16:50 -07:00
Andrey Goncharov
ca009d1233 Ignoring errors from "send"
Summary: "send" returns "void" which means we do not care about the execution result, including errors

Reviewed By: lblasa

Differential Revision: D47398015

fbshipit-source-id: ef185575f6e91d69356ab88c7f3d213033759da8
2023-07-13 03:23:56 -07:00
Lorenzo Blasa
f8e51dc847 ConnectivityHub integration
Summary:
This change has a minimal Connectivity Hub with a log viewer of connectivity related events.

The hub is integrated so that is usable.

Reviewed By: antonk52

Differential Revision: D47296027

fbshipit-source-id: 7611ce0b1480e9bdb7cdff2bcedeb445a322c195
2023-07-10 05:52:07 -07:00
Lorenzo Blasa
fc38355eee Centralise logging
Summary:
Centralise connectivity logging into a single place. By having all logs go through a single interface, then it becomes trivial to manipulate them as needed.

In this change, this is not done.

In subsequent diffs, logs will be dispatched via an event and will be visualised in the Connectivity Hub.

Reviewed By: passy

Differential Revision: D47185054

fbshipit-source-id: fb5eab98895be0c8f61fb9a77d3e66d6a8dbcb27
2023-07-10 04:14:14 -07:00
Lorenzo Blasa
87c5296cd8 Scaffolding
Summary:
Scaffolding connectivity hub. The final place may be different though.

But at least for now whilst we iterate on the solution, this should be enough.

Reviewed By: passy

Differential Revision: D47230905

fbshipit-source-id: e3b3f7d773e1bf8b0dd9821cf25c6fa8e77669f4
2023-07-06 06:57:53 -07:00
Lorenzo Blasa
9810edcdfb Remove usage of ReactDOM.render for root
Summary: As per comment, the issue is already fixed and released.

Reviewed By: LukeDefeo

Differential Revision: D47257442

fbshipit-source-id: 2a975690bab0eaed12b6b4233be41f675760a0bc
2023-07-06 05:14:00 -07:00
Pascal Hartig
2b17ac76de Temporarily switch to console-feed mirror
Summary:
See https://github.com/samdenty/console-feed/issues/124.

This is breaking our CI and lots of other things. We should hopefully be able to cleanly revert this on Monday.

Reviewed By: ivanmisuno

Differential Revision: D47150333

fbshipit-source-id: f34d6afdb83607c8ac2cc7fb2989ca68733798e0
2023-06-30 05:53:31 -07:00
Lorenzo Blasa
dac8c5b213 Usage track now internal to tracking
Summary:
Usage tracking comes from Electron's `main.tsx`. There's a timer that dispatches an IPC event every 60 seconds.

This is all good for Electron builds.

For non-electron builds, there's no such thing as IPC.

So, react to the IPC event whenever necessary but also handle the interval internally such that usage is tracked independently of explicit callers.

Reviewed By: antonk52

Differential Revision: D47053404

fbshipit-source-id: f17694e65eed18678b45a2e815813bafab69c3f1
2023-06-27 07:17:06 -07:00
Lorenzo Blasa
fe12a908fb Remove debugging comment
Summary: ^

Reviewed By: LukeDefeo

Differential Revision: D47053235

fbshipit-source-id: af17955a333059cce58a68a43ecdcb67a441d7b5
2023-06-27 04:28:04 -07:00
Lorenzo Blasa
cadf5a3656 starred-plugins removal
Summary: A transition period of 2 years should be enough.

Reviewed By: LukeDefeo

Differential Revision: D47053216

fbshipit-source-id: c9f9bfbff82a05942d408b325088095a6069cced
2023-06-27 04:28:04 -07:00
Anton Kastritskiy
62f4582f0e Merge device plugins and enabled plugins in the sidebar
Summary:
Currently we surface the difference in plugin type to the user. However, it doesn't make much sence to the user as they primarily care about the plugins being enabled or not. Thus merging device plugins (always enabled) and enabled plugins sections.

I wasn't sure if I should also merge the metro plugins section due to some metro specific hints. So I left it as is.

Reviewed By: lblasa

Differential Revision: D46971125

fbshipit-source-id: 0bb667c3b2f5576e5704dae29b03cfd631c38ad2
2023-06-23 07:19:03 -07:00
Lorenzo Blasa
daa3a38ed3 Flipper export file implementation
Summary:
^

Changelog: add export file implementation for browsers

Reviewed By: antonk52

Differential Revision: D46840341

fbshipit-source-id: 8a011f2a7c0ce329286cb8813def8f9c0572d133
2023-06-19 08:33:54 -07:00
Andrey Goncharov
84e481e7e9 Expose dark mode flag to plugin authors
Summary:
Should be available now with
```
getFlipperLib().settings().isDarkMode
```

Differential Revision: D46685851

fbshipit-source-id: 0777437b7ca06051cc3fd4dc1b794242f453f2b5
2023-06-13 08:18:14 -07:00
Michel Weststrate
56694b441e Use assets_DO_NOT_HARDCODE in public as well
Summary: Since ~couple of days to last week we cannot download image assets anymore from facebook.com during build, which is worked around in previous diff. This diff fixes it also in the development environment (`yarn start`)

Reviewed By: lblasa

Differential Revision: D46556075

fbshipit-source-id: ee5d912fb06d1632c41ff6d536b64a55608f5848
2023-06-09 04:01:17 -07:00
Michel Weststrate
50f50fa46c fall back to larger images if requested size is not available
Summary: This diff follows up on the previous one, by trying a larger icon size if the original requested icon size was missing.

Reviewed By: lblasa

Differential Revision: D46556076

fbshipit-source-id: 4a078088aa27390f247e39afeda4b1df261d8b30
2023-06-08 07:31:34 -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
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
Anton Kastritskiy
fda21e96e8 Update typescript to 4.9.5
Reviewed By: passy

Differential Revision: D46068908

fbshipit-source-id: 4c1ffff8690eec5a10c67d6c5d1aacf224e0f0d4
2023-05-23 03:15:10 -07:00
dependabot[bot]
f65c99c6b2 Bump deep-equal from 2.0.5 to 2.2.1 in /desktop (#4729)
Summary:
Bumps [deep-equal](https://github.com/inspect-js/node-deep-equal) from 2.0.5 to 2.2.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/inspect-js/node-deep-equal/blob/master/CHANGELOG.md">deep-equal's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/inspect-js/node-deep-equal/compare/v2.2.0...v2.2.1">v2.2.1</a> - 2023-04-27</h2>
<h3>Commits</h3>
<ul>
<li>[Tests] add passing tests covering object key ordering <a href="51c9ff6b4c"><code>51c9ff6</code></a></li>
<li>[Refactor] use <code>array-buffer-byte-length</code> <a href="f47822cf0c"><code>f47822c</code></a></li>
<li>[Deps] update <code>is-array-buffer</code>, <code>regexp.prototype.flags</code> <a href="160d851333"><code>160d851</code></a></li>
<li>[Deps] update <code>es-get-iterator</code>, <code>get-intrinsic</code> <a href="2e08e956a4"><code>2e08e95</code></a></li>
<li>[Dev Deps] update <code>object.getownpropertydescriptors</code> <a href="63e9ab7450"><code>63e9ab7</code></a></li>
<li>[Dev Deps] update <code>tape</code> <a href="c8db964f60"><code>c8db964</code></a></li>
</ul>
<h2><a href="https://github.com/inspect-js/node-deep-equal/compare/v2.1.0...v2.2.0">v2.2.0</a> - 2023-01-05</h2>
<h3>Commits</h3>
<ul>
<li>[New] add support for <code>SharedArrayBuffer</code> <a href="0ef51c79b7"><code>0ef51c7</code></a></li>
<li>[Refactor] use <code>is-array-buffer</code> package <a href="0360ee1f1b"><code>0360ee1</code></a></li>
<li>[Fix] <code>whichTypedArray</code> can return false in both cases <a href="df3e3c4e30"><code>df3e3c4</code></a></li>
<li>[Dev Deps] update <code>aud</code>, <code>object.getownpropertydescriptors</code> <a href="6d62ea4f2b"><code>6d62ea4</code></a></li>
<li>[Dev Deps] update <code>ljharb/eslint-config</code> <a href="15aab59d64"><code>15aab59</code></a></li>
<li>[Deps] update <code>which-typed-array</code> <a href="8dfce27f33"><code>8dfce27</code></a></li>
<li>[eslint] remove <code>.eslintignore</code> <a href="af46773b28"><code>af46773</code></a></li>
</ul>
<h2><a href="https://github.com/inspect-js/node-deep-equal/compare/v2.0.5...v2.1.0">v2.1.0</a> - 2022-11-02</h2>
<h3>Fixed</h3>
<ul>
<li>[New] add support for <code>ArrayBuffer</code> <a href="https://redirect.github.com/inspect-js/node-deep-equal/issues/94"><code>[https://github.com/facebook/flipper/issues/94](https://github.com/inspect-js/node-deep-equal/issues/94)</code></a></li>
</ul>
<h3>Commits</h3>
<ul>
<li>[actions] reuse common workflows <a href="12de2873de"><code>12de287</code></a></li>
<li>[actions] use <code>node/install</code> instead of <code>node/run</code>; use <code>codecov</code> action <a href="ec248b96f4"><code>ec248b9</code></a></li>
<li>[Tests] run assert tests on a dynamic matrix <a href="695aebd509"><code>695aebd</code></a></li>
<li>[readme] add badges <a href="492e159158"><code>492e159</code></a></li>
<li>[Test] ArrayBuffers in node &lt; 0.12 have a nonconfigurable own <code>byteLength</code> property <a href="40f4b87196"><code>40f4b87</code></a></li>
<li>[meta] use <code>npmignore</code> to autogenerate an npmignore file <a href="2627269314"><code>2627269</code></a></li>
<li>[Dev Deps] update <code>eslint</code>, <code>ljharb/eslint-config</code>, <code>safe-publish-latest</code>, <code>tape</code> <a href="7a05bb7482"><code>7a05bb7</code></a></li>
<li>[Deps] update <code>call-bind</code>, <code>es-get-iterator</code>, <code>get-intrinsic</code>, <code>is-arguments</code>, <code>is-regex</code>, <code>regexp.prototype.flags</code>, <code>side-channel</code>, <code>which-boxed-primitive</code>, <code>which-typed-array</code> <a href="c0844e629b"><code>c0844e6</code></a></li>
<li>[actions] update codecov uploader <a href="b1b0552fe3"><code>b1b0552</code></a></li>
<li>[Dev Deps] update <code>eslint</code>, <code>ljharb/eslint-config</code>, <code>aud</code>, <code>auto-changelog</code>, <code>has-symbols</code>, <code>object.getownpropertydescriptors</code>, <code>tape</code> <a href="9a1ccf5285"><code>9a1ccf5</code></a></li>
<li>[meta] do not publish github action workflow files <a href="2d63384d66"><code>2d63384</code></a></li>
<li>[actions] update rebase action to use reusable workflow <a href="69d21f55af"><code>69d21f5</code></a></li>
<li>[Dev Deps] update <code>eslint</code>, <code>ljharb/eslint-config</code>, <code>aud</code>, <code>has-symbols</code>, <code>object.getownpropertydescriptors</code>, <code>tape</code> <a href="297aae88f6"><code>297aae8</code></a></li>
<li>[Tests] add tests for regexes with the same source but different flags <a href="29c8a0da09"><code>29c8a0d</code></a></li>
<li>[Dev Deps] update <code>eslint</code>, <code>ljharb/eslint-config</code> <a href="9e64ec93a8"><code>9e64ec9</code></a></li>
<li>[Deps] update <code>is-arguments</code>, <code>is-date-object</code>, <code>is-regex</code>, <code>which-typed-array</code> <a href="edfb752810"><code>edfb752</code></a></li>
<li>[Dev Deps] update <code>eslint</code>, <code>ljharb/eslint-config</code>, <code>auto-changelog</code>, <code>tape</code> <a href="7b5f7a348b"><code>7b5f7a3</code></a></li>
<li>[Dev Deps] update <code>eslint</code>, <code>ljharb/eslint-config</code>, <code>has-typed-arrays</code>, <code>tape</code> <a href="e328a237ba"><code>e328a23</code></a></li>
<li>[Deps] update <code>get-intrinsic</code>, <code>regexp.prototype.flags</code>, <code>which-typed-array</code> <a href="29123a7185"><code>29123a7</code></a></li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="6ea6b8d296"><code>6ea6b8d</code></a> v2.2.1</li>
<li><a href="f47822cf0c"><code>f47822c</code></a> [Refactor] use <code>array-buffer-byte-length</code></li>
<li><a href="160d851333"><code>160d851</code></a> [Deps] update <code>is-array-buffer</code>, <code>regexp.prototype.flags</code></li>
<li><a href="63e9ab7450"><code>63e9ab7</code></a> [Dev Deps] update <code>object.getownpropertydescriptors</code></li>
<li><a href="2e08e956a4"><code>2e08e95</code></a> [Deps] update <code>es-get-iterator</code>, <code>get-intrinsic</code></li>
<li><a href="c8db964f60"><code>c8db964</code></a> [Dev Deps] update <code>tape</code></li>
<li><a href="51c9ff6b4c"><code>51c9ff6</code></a> [Tests] add passing tests covering object key ordering</li>
<li><a href="b9d9e54c27"><code>b9d9e54</code></a> v2.2.0</li>
<li><a href="0ef51c79b7"><code>0ef51c7</code></a> [New] add support for <code>SharedArrayBuffer</code></li>
<li><a href="0360ee1f1b"><code>0360ee1</code></a> [Refactor] use <code>is-array-buffer</code> package</li>
<li>Additional commits viewable in <a href="https://github.com/inspect-js/node-deep-equal/compare/v2.0.5...v2.2.1">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=deep-equal&package-manager=npm_and_yarn&previous-version=2.0.5&new-version=2.2.1)](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/4729

Reviewed By: passy

Differential Revision: D46016549

Pulled By: ivanmisuno

fbshipit-source-id: bbce2af026fba2c5d7622c4593b241155cc6e82e
2023-05-19 05:40:02 -07:00
Lorenzo Blasa
8400e6b240 Don't ask to install PWA if running as Electron
Summary:
I had wrongly assumed the display mode was standalone for Electron, but it turns out that is not the case.

So, explicitly prevent showing the wizard in Electron builds.

Reviewed By: antonk52

Differential Revision: D45983295

fbshipit-source-id: 0bd770d28c0e52a7417789751ac78c5f84165d86
2023-05-18 06:29:00 -07:00
Lorenzo Blasa
1a6fac2a50 Only show PWA wizard in production
Summary: ^

Reviewed By: antonk52

Differential Revision: D45942615

fbshipit-source-id: e759da943396d85cd68169f79818d7037f5a940b
2023-05-17 03:50:40 -07:00
Lorenzo Blasa
5830333e0d PWA installation wizard usage tracking
Summary: Get some metrics from the PWA installation wizard.

Reviewed By: antonk52

Differential Revision: D45863352

fbshipit-source-id: 1cf8912a47c749b3b2c2e573796ee1935ea172c9
2023-05-16 04:32:47 -07:00
Lorenzo Blasa
c6d5eb3334 Flipper as PWA
Summary:
^

Reference: https://docs.google.com/document/d/1flQJUzTe4AuQz3QCpvbloQycenHsu7ZxbKScov7K7ao

Reviewed By: passy

Differential Revision: D45693382

fbshipit-source-id: 5a2e6c213a7e7e2cf9cd5f3033cff3e5291a2a92
2023-05-16 04:32:47 -07:00
Lorenzo Blasa
47a4c10c67 Improve error logs readability
Summary:
Setting the background to red for error logs has a lot of implications for all text colouring inside of its container.

Instead, set the error border to red, which gives a clear error indication whilst making things easier to read.

changelog: Improve console error logs readability

Reviewed By: mweststrate

Differential Revision: D45861604

fbshipit-source-id: 51f557451ac16269b69ff830a26328552e134ee5
2023-05-15 05:35:32 -07:00
Pascal Hartig
0c85da8651 Demote unhelpful "Network Error" from axios to warning
Summary:
Axios can create rather unhelpful errors, e.g. https://www.internalfb.com/logview/details/flipper_javascript/3201603bcb7148a3f37775f184dbda44?trace_key=f2a7f3d0e7b914b8a3adf30648263313&selected-logview-tab=shared

This should hopefully turn them into warnings.

Reviewed By: antonk52

Differential Revision: D45043390

fbshipit-source-id: 90108b7056943214d78ec9c235ac11aae9a7ecdc
2023-04-17 05:06:50 -07:00
Michel Weststrate
cd7a6bfc40 Log queue overflows
Summary: ^

Reviewed By: aigoncharov

Differential Revision: D44705144

fbshipit-source-id: 9a31d18c1f433bd09d399c3b4dce28726e1e9c72
2023-04-06 03:20:42 -07:00
Luke De Feo
a9b17ac637 Add log tailing infra and downgrade resize observer error to warn
Summary: Resize oberserver limit exceeded appears to be a benign error that we can safely ignore, added ability to change log level. Given we report errors to our user logs, fb log view and console the console log patching has been centralised and now logs are pushed to whatever destinations we have.

Reviewed By: lblasa

Differential Revision: D44666836

fbshipit-source-id: e028dbc52b00947097833f9f3619189226247e1d
2023-04-04 07:58:57 -07:00
Andrey Goncharov
7f111a11de Expose isConnected and currentUser
Summary: Requested by antonk52 and MSYS team

Reviewed By: passy

Differential Revision: D44662243

fbshipit-source-id: 2bace476c4e79b6a05bfb89ddc3e6acb437c6c3b
2023-04-04 05:26:31 -07:00
Andrey Goncharov
b3307baafe Make isLoggedIn report user value instead of bool
Summary: It makes little sense to hide this info from developers. It was also requested by antonk52

Reviewed By: LukeDefeo

Differential Revision: D44631235

fbshipit-source-id: 1756c5ca2a95b2f815f8c4336621d3c057b704f2
2023-04-04 05:26:31 -07:00
Luke De Feo
2e8427f26b Add getUser back as deprecated method
Summary: On downloading  the new flipper update some of the older plugins which are on a different release cycle may try to call getUser which was removed in this stack in favour of getCached user and fetchUser, adding this back temporarily so those calls dont fail. This can be removed down the road once those plugins have soaked into the user base

Reviewed By: ivanmisuno, aigoncharov

Differential Revision: D44541277

fbshipit-source-id: 95e67d5ba11bbc26590d2789127cbf6a68c54f16
2023-03-30 10:05:59 -07:00
Luke De Feo
140ca5991e Dont show token notification when sign in sheet open
Summary: This is an edge case where if we make a intern call  to fetch user with an invalid token we would imply that the token may have expired. Since we already have a error message in the sign in sheet we dont show the notification

Reviewed By: aigoncharov

Differential Revision: D44502480

fbshipit-source-id: 531df6db28bc2a6f36ffcf0a3903ee0e8e40be0f
2023-03-30 10:05:59 -07:00
Luke De Feo
e47d99a69e Remove unused plugin update command / redux action
Summary:
This command is never actually dispatched so removing to avoid future confusion.

When new plugins are downloaded a check is done here https://fburl.com/code/e3zedljb to see if pluginIsDisabledForAllConnectedClients, if so, load command is queued, which internally calls update (which resets state)

If the plugin is not disabled then a message appears asking user to manually reload.

Reviewed By: aigoncharov

Differential Revision: D44502476

fbshipit-source-id: b796b77f843218c07ee612d9f45cacba073362d3
2023-03-30 10:05:59 -07:00
Luke De Feo
f8e326f4d5 Rename login/logout of reducer to setUserProfile
Summary: The source of truth for logging in is the atom, the userprofile is a side effect and is cached so calling these actions login/logout is very confusing, especially considering those functions exist elsewhere that manage the atoms

Reviewed By: aigoncharov

Differential Revision: D44502481

fbshipit-source-id: 77080cc02134684a58f52fcad74041b4508a22f0
2023-03-30 10:05:59 -07:00
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
dependabot[bot]
15e1c99245 Bump reselect from 4.1.5 to 4.1.7 in /desktop (#4541)
Summary:
Bumps [reselect](https://github.com/reduxjs/reselect) from 4.1.5 to 4.1.7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/reduxjs/reselect/releases">reselect's releases</a>.</em></p>
<blockquote>
<h2>v4.1.7</h2>
<p>This release updates the TS types to work correctly with TS 4.9, which made a change that broke the existing <code>MergeParameters</code> type implementation.  Happily, the TS team <a href="https://github-redirect.dependabot.com/microsoft/TypeScript/pull/50831#issuecomment-1253830522">provided a better (and simpler!) <code>MergeParameters</code> implementation</a>.  Since that only works with TS 4.7+, we've reworked the internals to handle providing the old implementation to TS 4.2..4.6, and the new implementation to TS 4.7 and greater.</p>
<p>As a user, there should be no visible change - just update to 4.1.7.</p>
<h2>What's Changed</h2>
<ul>
<li>Include 4.6 in the TS test matrix by <a href="https://github.com/lukeapage"><code>@​lukeapage</code></a> in <a href="https://github-redirect.dependabot.com/reduxjs/reselect/pull/576">reduxjs/reselect#576</a></li>
<li>TS 4.9 compat by <a href="https://github.com/markerikson"><code>@​markerikson</code></a> in <a href="https://github-redirect.dependabot.com/reduxjs/reselect/pull/587">reduxjs/reselect#587</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/reduxjs/reselect/compare/v4.1.6...v4.1.7">https://github.com/reduxjs/reselect/compare/v4.1.6...v4.1.7</a></p>
<h2>v4.1.6</h2>
<p>This release updates the TS types to better handle cases with default parameters, or <code>any/unknown</code> types.</p>
<h2>What's Changed</h2>
<ul>
<li>Fix <a href="https://github-redirect.dependabot.com/reduxjs/reselect/issues/563">https://github.com/facebook/flipper/issues/563</a> - Make it an error when the typings become incorrect by <a href="https://github.com/lukeapage"><code>@​lukeapage</code></a> in <a href="https://github-redirect.dependabot.com/reduxjs/reselect/pull/572">reduxjs/reselect#572</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/reduxjs/reselect/compare/v4.1.5...v4.1.6">https://github.com/reduxjs/reselect/compare/v4.1.5...v4.1.6</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="32b66389b9"><code>32b6638</code></a> Release 4.1.7</li>
<li><a href="e4c2ace5cf"><code>e4c2ace</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/reduxjs/reselect/issues/587">https://github.com/facebook/flipper/issues/587</a> from reduxjs/feature/ts-4.9-compat</li>
<li><a href="11ed107b50"><code>11ed107</code></a> Rewrite <code>MergeParameters</code> to work with TS 4.9</li>
<li><a href="5b83d04e08"><code>5b83d04</code></a> Bump TS to 4.8</li>
<li><a href="f57ef857d4"><code>f57ef85</code></a> Move TS 4.1 types into <code>src/legacyTypes</code></li>
<li><a href="69a4ff4fab"><code>69a4ff4</code></a> Bump Prettier and RTK</li>
<li><a href="e5d99b9948"><code>e5d99b9</code></a> Update TS test matrix to 4.9 RC</li>
<li><a href="f53eb41d76"><code>f53eb41</code></a> Merge branch 'master' of github.com:reduxjs/reselect</li>
<li><a href="9d62d03456"><code>9d62d03</code></a> Release 4.1.6</li>
<li><a href="d49e4e1145"><code>d49e4e1</code></a> Give internal memoize callback functions names for dev readability</li>
<li>Additional commits viewable in <a href="https://github.com/reduxjs/reselect/compare/v4.1.5...v4.1.7">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=reselect&package-manager=npm_and_yarn&previous-version=4.1.5&new-version=4.1.7)](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/4541

Reviewed By: ivanmisuno

Differential Revision: D44215180

Pulled By: mweststrate

fbshipit-source-id: 9c39c40132f825a6dcffa74b7daad3dcb776d766
2023-03-24 04:04:16 -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