Commit Graph

12 Commits

Author SHA1 Message Date
Michel Weststrate
c9a34d3cc2 Fix inconsistent handling of app id and name
Summary:
Changelog: Improved plugin / device / app selection handing.

During some refactorings I discovered that the `connetions.selectedApp` field contained sometimes an application id, and sometimes just the name. This caused inconsistent behavior especially in unit tests.

I've cleaned that up, and renamed it to `selectedAppId` where applicable, to make the distinction more clear.

And, in contrast, userPreferredApp now always has a name, not an id.

During refactoring our existing selection update logic was quite in the way, which was overcomplicated still, since during the sandy chrome migration, the reducers needed to be able to handle both the old UI, and the new application selection UI. That logic has been simplified now, and a lot of tests were added.

As a further simplification the preferredApp/Device/Plugin are now only read and used when updating selection, but not when running selectors.

Reviewed By: timur-valiev

Differential Revision: D31305180

fbshipit-source-id: 2dbd9f9c33950227cc63aa29cc4a98bdd0db8e7a
2021-10-04 07:27:24 -07:00
Michel Weststrate
57d00e0bab One sleep to rule them all. Zzz
Summary: Boyscouted some code duplication away.

Reviewed By: jknoxville

Differential Revision: D29731016

fbshipit-source-id: d5f1677a667f032f6e7e031da296be26e1976932
2021-07-16 03:43:36 -07:00
Anton Nikolaev
9a2677fc24 Cleanup global notifications UI
Summary: We don't need to show plugin-related details and button "open globalError" (which anyway doesn't work) when showing global notifications.

Reviewed By: passy

Differential Revision: D28900468

fbshipit-source-id: 54347ede4f1e4dbfb0e41be5c50374fda35c1223
2021-06-07 05:53:44 -07:00
Anton Nikolaev
90d40ac385 More actionable notification message in case of www cert exchange failed
Summary: Improved message a bit to make it clear that VPN/Lighthouse is required on both sides - computer and mobile device. Also it will now show login link in case user is not signed in yet, because login is also required for www cert exchange.

Reviewed By: passy

Differential Revision: D28899558

fbshipit-source-id: 89de776f602a9f27a2c068efd8e3f08c28ec5f57
2021-06-07 05:53:43 -07:00
Michel Weststrate
4e2383cdb0 Introduce showNotification API
Summary: Introduced `showNotifcation` to the Sandy API.

Reviewed By: jknoxville

Differential Revision: D27012001

fbshipit-source-id: d3f237910a478400b0f925f0362af485c96072bb
2021-03-16 15:03:47 -07:00
Michel Weststrate
8d5f136a34 Fix active state reducer mutating existing state
Summary:
This reducer was mutating existing state, which will throw since we freeze state to prevent exactly that. Fixed it by using a defensive copy.

Note that `newActiveNotifications` doesn't suffer from the same as it is freshly allocated.

See https://www.internalfb.com/intern/diffusion/FBS/browse/master/xplat/sonar/desktop/app/src/reducers/notifications.tsx?commit=29b592866b44&lines=160

Reviewed By: passy

Differential Revision: D26399200

fbshipit-source-id: 5f9f22db3de48f4f595a028faf9e9ec547641cfb
2021-02-11 03:41:54 -08:00
Pascal Hartig
9469ad33af Make addErrorNotification raise a warning
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
2021-02-02 10:58:50 -08:00
Chaiwat Ekkaewnumchai
21ad9ad433 Rename Notification Blacklist to Blocklist
Summary: per title

Reviewed By: mweststrate

Differential Revision: D25021786

fbshipit-source-id: 444e0959b5a4157171dad5c81b102abf105a99ed
2020-11-30 02:12:45 -08:00
Anton Nikolaev
0982dc06a0 Reload single plugin on auto-update
Summary: Implemented a way for re-loading single plugin on auto-update. This make it possible to apply update without full Flipper restart.

Reviewed By: mweststrate

Differential Revision: D23729972

fbshipit-source-id: ed30f7cde5a0537945db0b5bb6969ae8fde42cb6
2020-09-28 02:51:47 -07:00
Michel Weststrate
81eb09e7b0 Unify error notifications (#1483)
Summary:
Note: this is to be stacked upon https://github.com/facebook/flipper/pull/1479

Note: this PR will probably not succeed against FB internal flipper, as I'm pretty sure there are more call sites that need to be updated. So consider this WIP

Currently connection errors are managed in the connection reducers, and are displayed through their own means, the error bar. Showing console.errors is also hooked up to this mechanism in FB internal flipper, but not at all in the OSS version, which means that some connection errors are never shown to the user.

Besides that there is a notification system that is used by for example the crash reporter and plugin updater.

Having effectively (at least) two notifications mechanisms is confusing and error prone. This PR unifies both approaches, and rather than having the connection reducer manage it's own errors, it leverages the more generic notifications reducer. Since, in the previous PR, console errors and warnings have become user facing (even in OSS and production builds, which wasn't the case before), there is no need anymore for a separate error bar.

I left the notifications mechanism itself as-is, but as discussed in the Sandy project the notification screen will probably be overhauled, and the system wide notifications will become in-app notifications.

## Changelog

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

Test Plan: Only updated the unit tests at this point. Manual tests still need to be done.

Reviewed By: passy

Differential Revision: D23220896

Pulled By: mweststrate

fbshipit-source-id: 8ea37cf69ce9605dc232ca90afe9e2f70da26652
2020-08-21 10:08:21 -07:00
Anton Nikolaev
fb92a6f131 Show notification after plugin update downloaded
Summary: Add notification after plugin update downloaded

Reviewed By: passy

Differential Revision: D22016571

fbshipit-source-id: 188eeb848561f8461d7f76d1965dc5190d41e7d0
2020-06-12 06:15:29 -07:00
Anton Nikolaev
863f89351e Yarn workspaces
Summary:
1) moved "sonar/desktop/src" to "sonar/desktop/app/src", so "app" is now a separate package containing the core Flipper app code
2) Configured yarn workspaces with the root in "sonar/desktop": app, static, pkg, doctor, headless-tests. Plugins are not included for now, I plan to do this later.

Reviewed By: jknoxville

Differential Revision: D20535782

fbshipit-source-id: 600b2301960f37c7d72166e0d04eba462bec9fc1
2020-03-20 13:37:41 -07:00