Page MenuHomePhabricator

[keyserver] Update `updateUserAvatar` to construct `ClientImageAvatar`
ClosedPublic

Authored by atul on Apr 12 2023, 4:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 28, 2:04 PM
Unknown Object (File)
Fri, Jun 28, 2:04 PM
Unknown Object (File)
Fri, Jun 28, 2:04 PM
Unknown Object (File)
Fri, Jun 28, 2:04 PM
Unknown Object (File)
Fri, Jun 28, 2:02 PM
Unknown Object (File)
Thu, Jun 13, 12:16 PM
Unknown Object (File)
Tue, Jun 11, 9:42 PM
Unknown Object (File)
Tue, Jun 11, 6:30 PM
Subscribers

Details

Summary

Update updateUserAvatar to return properly constructed ClientImageAvatar if the request was of type image.


Depends on D7404

Test Plan
  1. Set image avatar for user
  2. Observe that UPDATE_USER_AVATAR_SUCCESS payload includes correctly constructed ClientImageAvatar
  3. Observe that UserAvatar component looks correct throughout native

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Apr 12 2023, 4:24 PM
atul added inline comments.
keyserver/src/updaters/account-updaters.js
154–158 ↗(On Diff #25064)

It would be more correct if it was within the transaction as it would handle the case where there are multiple simultaneous calls to updateUserAvatar that may change the image avatar between the transaction being committed and this select statement returning its result set.

However, then we'd need to index into resultSet with some sort of hard-coded value (5) to pull out these values. That seems like it might be more human error-prone if someone makes changes to query that causes the indices to shift?

Personally would prefer hard-coding in a constant to ensure correctness, but figured I'd ask reviewers what they'd prefer.

This revision is now accepted and ready to land.Apr 12 2023, 6:01 PM