Page MenuHomePhabricator

[web] Support avatar uploads to blob service
ClosedPublic

Authored by bartek on Sep 12 2023, 3:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 6, 1:58 PM
Unknown Object (File)
Mon, Jan 6, 4:11 AM
Unknown Object (File)
Sun, Jan 5, 11:08 PM
Unknown Object (File)
Thu, Dec 26, 10:21 PM
Unknown Object (File)
Sun, Dec 15, 5:51 PM
Unknown Object (File)
Sun, Dec 15, 5:51 PM
Unknown Object (File)
Sun, Dec 15, 5:51 PM
Unknown Object (File)
Sun, Dec 15, 5:51 PM
Subscribers

Details

Summary

This diff enables avatar uploads to blob service on web. Modified the hook to conditionally use function that uploads avatar to blob service instead of keyserver. This is very similar to what we currently do with multimedia messages.

Test Plan

Tested on both user and thread avatars.
With the flag set to true, changed the avatar to an image and used TablePlus to verify MariaDB contents (this tests changes to D9168). Also, the avatar was then displayed correctly (which is more deeply tested in D9624)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

patryk held this revision as a draft.
patryk edited the test plan for this revision. (Show Details)
bartek edited reviewers, added: patryk; removed: bartek.
bartek edited the test plan for this revision. (Show Details)
bartek edited reviewers, added: ginsu; removed: patryk.
bartek published this revision for review.Oct 30 2023, 5:21 AM

Set the flag gate to false

This revision is now accepted and ready to land.Nov 1 2023, 7:19 PM

Rebase on multi-keyserver action update

web/avatars/edit-user-avatar-menu.react.js
74 ↗(On Diff #32842)

Comment above the definition of baseSetUserAvatar says:

// NOTE: Do **NOT** consume `baseSetUserAvatar` directly.
//       Use platform-specific `[web/native]SetUserAvatar` instead.

Are we sure this is okay? If we're sure it's okay, should we change the comment?

web/avatars/edit-user-avatar-menu.react.js
74 ↗(On Diff #32842)

I don't have much context on this, It was done this way before my diff.
There is nativeSetUserAvatar() but there is no webSetUserAvatar(). cc @atul who introduced this in D8344

web/avatars/avatar-hooks.react.js
24

Stripping these typehints doesn't work with the new version of Flow. I had to add them back in (addressed in today's rebase of D9771)