Page MenuHomePhabricator

D12332.id41102.diff
No OneTemporary

D12332.id41102.diff

diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -579,8 +579,6 @@
keyserverAuthCallSingleKeyserverEndpointOptions,
);
- const userInfosArrays = [];
-
let threadInfos: RawThreadInfos = {};
const calendarResult: WritableCalendarResult = {
calendarQuery: keyserverAuthInfo.calendarQuery,
@@ -618,22 +616,29 @@
...updatesCurrentAsOf,
[keyserverID]: responses[keyserverID].serverTime,
};
- userInfosArrays.push(responses[keyserverID].userInfos);
- userInfosArrays.push(responses[keyserverID].cookieChange.userInfos);
}
- const userInfos = mergeUserInfos(...userInfosArrays);
+ const authKeyserverID = authoritativeKeyserverID();
+ let userInfos: $ReadOnlyArray<UserInfo> = [];
+ if (responses[authKeyserverID]) {
+ const userInfosArrays = [
+ responses[authKeyserverID].userInfos,
+ responses[authKeyserverID].cookieChange.userInfos,
+ ];
+
+ userInfos = mergeUserInfos(...userInfosArrays);
+ }
return {
threadInfos,
- currentUserInfo: responses[authoritativeKeyserverID()]?.currentUserInfo,
+ currentUserInfo: responses[authKeyserverID]?.currentUserInfo,
calendarResult,
messagesResult,
userInfos,
updatesCurrentAsOf,
authActionSource: keyserverAuthInfo.authActionSource,
notAcknowledgedPolicies:
- responses[authoritativeKeyserverID()]?.notAcknowledgedPolicies,
+ responses[authKeyserverID]?.notAcknowledgedPolicies,
preRequestUserInfo,
};
};
diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js
--- a/lib/reducers/user-reducer.js
+++ b/lib/reducers/user-reducer.js
@@ -374,7 +374,10 @@
[],
userStoreOps,
];
- } else if (action.type === keyserverAuthActionTypes.success) {
+ } else if (
+ action.type === keyserverAuthActionTypes.success &&
+ relyingOnAuthoritativeKeyserver
+ ) {
const newUserInfos = _keyBy(userInfo => userInfo.id)(
action.payload.userInfos,
);

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 9:44 AM (12 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2681355
Default Alt Text
D12332.id41102.diff (2 KB)

Event Timeline