Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33315351
D11500.1768825067.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D11500.1768825067.diff
View Options
diff --git a/lib/components/keyserver-connection-handler.js b/lib/components/keyserver-connection-handler.js
--- a/lib/components/keyserver-connection-handler.js
+++ b/lib/components/keyserver-connection-handler.js
@@ -34,6 +34,7 @@
import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js';
import type { CallSingleKeyserverEndpoint } from '../utils/call-single-keyserver-endpoint.js';
import { getConfig } from '../utils/config.js';
+import { getMessageForException } from '../utils/errors.js';
import { useDispatchActionPromise } from '../utils/redux-promise-utils.js';
import { useSelector } from '../utils/redux-utils.js';
import {
@@ -147,24 +148,25 @@
throw new Error(CANCELLED_ERROR);
}
- await dispatchActionPromise(
- keyserverAuthActionTypes,
- keyserverAuthRawAction(innerCallKeyserverEndpoint)({
- userID,
- deviceID,
- doNotRegister,
- calendarQuery,
- deviceTokenUpdateInput,
- authActionSource,
- keyserverData: {
- [keyserverID]: {
- initialContentEncryptedMessage: contentSession.message,
- initialNotificationsEncryptedMessage: notifsSession,
- },
+ const authPromise = keyserverAuthRawAction(
+ innerCallKeyserverEndpoint,
+ )({
+ userID,
+ deviceID,
+ doNotRegister,
+ calendarQuery,
+ deviceTokenUpdateInput,
+ authActionSource,
+ keyserverData: {
+ [keyserverID]: {
+ initialContentEncryptedMessage: contentSession.message,
+ initialNotificationsEncryptedMessage: notifsSession,
},
- preRequestUserInfo,
- }),
- );
+ },
+ preRequestUserInfo,
+ });
+
+ await dispatchActionPromise(keyserverAuthActionTypes, authPromise);
} catch (e) {
if (hasBeenCancelled()) {
return;
@@ -253,12 +255,30 @@
const innerPerformRecovery = React.useCallback(
(
recoveryActionSource: RecoveryActionSource,
+ setInProgress: boolean => mixed,
hasBeenCancelled: () => boolean,
) =>
async (
callSingleKeyserverEndpoint: CallSingleKeyserverEndpoint,
innerCallKeyserverEndpoint: CallKeyserverEndpoint,
) => {
+ if (usingCommServicesAccessToken) {
+ try {
+ await innerPerformAuth(
+ recoveryActionSource,
+ setInProgress,
+ hasBeenCancelled,
+ true,
+ )(innerCallKeyserverEndpoint);
+ } catch (e) {
+ console.log(
+ `Tried to recover session with keyserver ${keyserverID} but got ` +
+ `error. Exception: ` +
+ (getMessageForException(e) ?? '{no exception message}'),
+ );
+ }
+ return;
+ }
if (!resolveKeyserverSessionInvalidationUsingNativeCredentials) {
return;
}
@@ -273,6 +293,7 @@
);
},
[
+ innerPerformAuth,
resolveKeyserverSessionInvalidationUsingNativeCredentials,
dispatchActionPromise,
keyserverID,
@@ -296,7 +317,11 @@
try {
await keyserverRecoveryLogIn(
recoveryActionSource,
- innerPerformRecovery(recoveryActionSource, hasBeenCancelled),
+ innerPerformRecovery(
+ recoveryActionSource,
+ setAuthInProgress,
+ hasBeenCancelled,
+ ),
hasBeenCancelled,
);
} finally {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 19, 12:17 PM (6 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5956280
Default Alt Text
D11500.1768825067.diff (3 KB)
Attached To
Mode
D11500: [lib] Use identity service for keyserver session recovery
Attached
Detach File
Event Timeline
Log In to Comment