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
This commit is contained in:
Anton Nikolaev
2021-06-07 05:52:50 -07:00
committed by Facebook GitHub Bot
parent edbb41b49b
commit 90d40ac385
2 changed files with 39 additions and 7 deletions

View File

@@ -16,6 +16,10 @@ import {UninitializedClient} from '../UninitializedClient';
import {addErrorNotification} from '../reducers/notifications';
import {CertificateExchangeMedium} from '../utils/CertificateProvider';
import {selectClient, selectDevice} from '../reducers/connections';
import {isLoggedIn} from '../fb-stubs/user';
import React from 'react';
import {Typography} from 'antd';
import {ACTIVE_SHEET_SIGN_IN, setActiveSheet} from '../reducers/application';
export default (store: Store, logger: Logger) => {
const server = new Server(logger, store);
@@ -71,7 +75,6 @@ export default (store: Store, logger: Logger) => {
({
client,
medium,
deviceID,
}: {
client: UninitializedClient;
medium: CertificateExchangeMedium;
@@ -79,10 +82,31 @@ export default (store: Store, logger: Logger) => {
}) => {
store.dispatch(
addErrorNotification(
`Client ${client.appName} with device ${deviceID} took long time to connect back on the trusted channel.`,
medium === 'WWW'
? 'Verify that you are on lighthouse on your client and have a working internet connection. To connect to lighthouse on your client, use VPN. Follow this link: https://www.internalfb.com/intern/wiki/Ops/Network/Enterprise_Network_Engineering/ene_wlra/VPN_Help/Vpn/mobile/'
: 'Verify if your client is connected to Flipper and verify if there is no error related to idb.',
`Timed out establishing connection with "${client.appName}" on "${client.deviceName}".`,
medium === 'WWW' ? (
<>
Verify that both your computer and mobile device are on
Lighthouse/VPN{' '}
{!isLoggedIn().get() && (
<>
and{' '}
<Typography.Link
onClick={() =>
store.dispatch(setActiveSheet(ACTIVE_SHEET_SIGN_IN))
}>
log in to Facebook Intern
</Typography.Link>
</>
)}{' '}
so they can exchange certificates.{' '}
<Typography.Link href="https://www.internalfb.com/intern/wiki/Ops/Network/Enterprise_Network_Engineering/ene_wlra/VPN_Help/Vpn/mobile/">
Check this link
</Typography.Link>{' '}
on how to enable VPN on mobile device.
</>
) : (
'Verify that your client is connected to Flipper and that there is no error related to idb.'
),
),
);
},