Page MenuHomePhabricator

D12509.id41687.diff
No OneTemporary

D12509.id41687.diff

diff --git a/lib/handlers/user-infos-handler.react.js b/lib/handlers/user-infos-handler.react.js
--- a/lib/handlers/user-infos-handler.react.js
+++ b/lib/handlers/user-infos-handler.react.js
@@ -41,6 +41,8 @@
const callUpdateRelationships =
useLegacyAshoatKeyserverCall(updateRelationships);
+ const currentUserInfo = useSelector(state => state.currentUserInfo);
+
React.useEffect(() => {
const newUserIDs = Object.keys(userInfosWithMissingUsernames).filter(
id => !requestedIDsRef.current.has(id),
@@ -66,16 +68,23 @@
void dispatchActionPromise(findUserIdentitiesActionTypes, promise);
// 2. Fetch avatars from auth keyserver
if (relyingOnAuthoritativeKeyserver) {
+ const userIDsWithoutOwnID = newUserIDs.filter(
+ id => id !== currentUserInfo?.id,
+ );
+ if (userIDsWithoutOwnID.length === 0) {
+ return;
+ }
void dispatchActionPromise(
updateRelationshipsActionTypes,
callUpdateRelationships({
action: relationshipActions.ACKNOWLEDGE,
- userIDs: newUserIDs,
+ userIDs: userIDsWithoutOwnID,
}),
);
}
}, [
callUpdateRelationships,
+ currentUserInfo?.id,
dispatchActionPromise,
findUserIdentities,
userInfos,
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
@@ -479,9 +479,13 @@
action.type === keyserverAuthActionTypes.success &&
relyingOnAuthoritativeKeyserver
) {
- const newUserInfos = _keyBy(userInfo => userInfo.id)(
+ const keyserverUserInfos = _keyBy(userInfo => userInfo.id)(
action.payload.userInfos,
);
+ const newUserInfos = discardKeyserverUsernames(
+ keyserverUserInfos,
+ state.userInfos,
+ );
const userStoreOps: $ReadOnlyArray<UserStoreOperation> =
convertUserInfosToReplaceUserOps(newUserInfos);

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 9:44 AM (18 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2681352
Default Alt Text
D12509.id41687.diff (1 KB)

Event Timeline