Page MenuHomePhabricator

[lib] Update `reduceUserInfos` to handle `updateUserAvatarActionTypes.success`
ClosedPublic

Authored by atul on May 1 2023, 1:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 17, 9:24 AM
Unknown Object (File)
Sun, Sep 15, 2:57 PM
Unknown Object (File)
Tue, Sep 3, 1:00 PM
Unknown Object (File)
Fri, Aug 30, 12:04 AM
Unknown Object (File)
Tue, Aug 27, 12:45 PM
Unknown Object (File)
Tue, Aug 27, 9:33 AM
Unknown Object (File)
Tue, Aug 27, 9:03 AM
Unknown Object (File)
Mon, Aug 26, 3:05 AM
Subscribers

Details

Summary

This change makes sure that the userInfo entry for the "current user" is updated in lockstep with currentUserInfo when the user updates their avatar.

After this diff when a user updates their avatar

  • The viewer's current session has their currentUserInfo and userInfos updated by updateUserAvatarActionTypes.success action payload
  • The viewer's other sessions are updated via "broadcast"-ed UPDATE_USER and UPDATE_CURRENT_USER
  • Non-viewer clients are updated via "broadcast"-ed UPDATE_USER

Depends on D7700

Test Plan

Observe that on updateUserAvatarActionTypes.success both currentUserInfo and userInfos are updated as expected on viewer's current session + other viewer session + peers.

LEFT: viewer (atul) updating profile picture
MIDDLE: viewer (atul) using a different device (different session)
RIGHT: peer (barack) PERSONAL thread w/ atul

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.May 1 2023, 1:31 PM
atul edited the test plan for this revision. (Show Details)
atul edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.May 1 2023, 2:01 PM

address feedback (i think)

atul requested review of this revision.May 1 2023, 3:03 PM
This revision is now accepted and ready to land.May 1 2023, 3:31 PM

resolve merge conflicts