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 = convertUserInfosToReplaceUserOps(newUserInfos);