Page MenuHomePhabricator

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

Authored by atul on May 1 2023, 1:29 PM.
Tags
None
Referenced Files
F3184738: D7701.diff
Fri, Nov 8, 11:46 AM
Unknown Object (File)
Tue, Nov 5, 2:11 AM
Unknown Object (File)
Oct 3 2024, 2:57 AM
Unknown Object (File)
Oct 3 2024, 2:57 AM
Unknown Object (File)
Oct 3 2024, 2:57 AM
Unknown Object (File)
Oct 3 2024, 2:57 AM
Unknown Object (File)
Oct 3 2024, 2:56 AM
Unknown Object (File)
Oct 3 2024, 2:51 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
Branch
arcpatch-D7700 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

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