Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3495719
D12509.id41687.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12509.id41687.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12509: [lib] Discard keyserver usernames for keyserverAuthActionTypes
Attached
Detach File
Event Timeline
Log In to Comment