Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3383096
D7682.id25970.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
D7682.id25970.diff
View Options
diff --git a/keyserver/src/updaters/account-updaters.js b/keyserver/src/updaters/account-updaters.js
--- a/keyserver/src/updaters/account-updaters.js
+++ b/keyserver/src/updaters/account-updaters.js
@@ -183,10 +183,7 @@
const selectResult = resultSet.pop();
const knownUserInfos: UserInfos = await fetchKnownUserInfos(viewer);
- const userUpdatesPromise = createUserAvatarUpdates(
- knownUserInfos,
- viewer.userID,
- );
+ const userUpdatesPromise = createUserAvatarUpdates(viewer, knownUserInfos);
handleAsyncPromise(userUpdatesPromise);
if (request.type === 'remove') {
@@ -209,23 +206,29 @@
}
async function createUserAvatarUpdates(
+ viewer: Viewer,
knownUserInfos: UserInfos,
- updatedUserID: string,
): Promise<void> {
- const usersToUpdate: $ReadOnlyArray<UserInfo> = values(knownUserInfos).filter(
- (user: UserInfo): boolean => user.id !== updatedUserID,
- );
const time = Date.now();
- const updateDatas: $ReadOnlyArray<UpdateData> = usersToUpdate.map(
+ const userUpdates: $ReadOnlyArray<UpdateData> = values(knownUserInfos).map(
(user: UserInfo): UpdateData => ({
type: updateTypes.UPDATE_USER,
userID: user.id,
time,
- updatedUserID: updatedUserID,
+ updatedUserID: viewer.userID,
}),
);
- await createUpdates(updateDatas);
+ const currentUserUpdate: UpdateData = {
+ type: updateTypes.UPDATE_CURRENT_USER,
+ userID: viewer.userID,
+ time,
+ };
+
+ await createUpdates([...userUpdates, currentUserUpdate], {
+ viewer,
+ updatesForCurrentSession: 'return',
+ });
}
export {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 1:35 PM (21 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2597142
Default Alt Text
D7682.id25970.diff (1 KB)
Attached To
Mode
D7682: [keyserver] Send `updateTypes.UPDATE_CURRENT_USER` to currentUser on `updateUserAvatar`
Attached
Detach File
Event Timeline
Log In to Comment