Page MenuHomePhabricator

[lib] Fix resetting thick thread avatars
ClosedPublic

Authored by bartek on Wed, Sep 11, 1:29 AM.
Tags
None
Referenced Files
F2765676: D13283.id44165.diff
Thu, Sep 19, 2:58 PM
F2764814: D13283.id44144.diff
Thu, Sep 19, 1:28 PM
F2764813: D13283.id44027.diff
Thu, Sep 19, 1:28 PM
F2761168: D13283.id.diff
Thu, Sep 19, 7:28 AM
F2756284: D13283.id.diff
Thu, Sep 19, 12:18 AM
F2755815: D13283.id44164.diff
Wed, Sep 18, 10:27 PM
Unknown Object (File)
Wed, Sep 18, 5:51 PM
Unknown Object (File)
Wed, Sep 18, 1:43 PM
Subscribers

Details

Summary

Addresses ENG-9208.
The case when avatar was reset for DM thread, wasn't supported in the thread-actions.js and later in the DM op.

Investigated how this is handled on keyserver and added appropriate logic here.

Test Plan

Confirmed that clicking the "Reset avatar" button in thread settings menu actually resets the avatar.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Wed, Sep 11, 1:55 AM
bartek added reviewers: tomek, inka.
bartek added inline comments.
lib/shared/dm-ops/change-thread-settings-spec.js
69

Empty string is the value that causes avatar to reset - keyserver does it the same way here

lib/types/dm-ops.js
291

Wondering if instead of null, it's better to use UpdateUserAvatarRemoveRequest here. This would make the above ternary much cleaner

tomek added inline comments.
lib/shared/dm-ops/change-thread-settings-spec.js
67–72

Can we simplify this expression and avoid nested ternaries?

lib/types/dm-ops.js
291

That makes sense but maybe we should use UpdateUserAvatarRequest then

This revision is now accepted and ready to land.Wed, Sep 11, 2:07 AM
lib/shared/dm-ops/change-thread-settings-spec.js
67–72

Yeah sure

lib/types/dm-ops.js
291

I guess it's not a good idea because we still need to convert UpdateUserAvatarRequest -> ClientAvatar at some point. Currently, we do it earlier, in thread-actions.js

lib/types/dm-ops.js
291

After refactoring ternaries I think null is clear enough, also left a comment

Replace ternaries to make conditions more readable

This revision was automatically updated to reflect the committed changes.