Page MenuHomePhabricator

[keyserver] Add thumbhash to upload endpoints
ClosedPublic

Authored by bartek on May 15 2023, 1:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 6:40 PM
Unknown Object (File)
Tue, Apr 16, 10:57 AM
Unknown Object (File)
Mon, Apr 15, 5:53 PM
Unknown Object (File)
Mon, Apr 15, 4:23 PM
Unknown Object (File)
Sat, Apr 13, 11:56 PM
Unknown Object (File)
Sat, Apr 13, 7:55 AM
Unknown Object (File)
Sat, Apr 13, 3:39 AM
Unknown Object (File)
Fri, Apr 12, 6:01 PM
Subscribers

Details

Summary

This adds possibility to store thumbhash on the keyserver. The thumbhash is saved to the extra column of the uploads table. Despite a deditated column being discussed, I decided to use the extras one for the sake of simplicity (avoid migration), and also because there are few other fields to consider when redesigning the uploads table schema (e.g. blob holder or encryption key which are even more important than the thumbhash).

Depends on D7802

Test Plan

Added the thumbhash property to the upload multimedia endpoint call in input-state-container. Checked with TablePlus that it's actually saved to the database.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.May 15 2023, 6:33 AM
ashoat requested changes to this revision.May 15 2023, 12:34 PM

Only requesting changes because I think you accidentally left a sleep call in there

keyserver/src/uploads/media-utils.js
71 ↗(On Diff #26438)

Should eg. inputLoop and inputDimensions be in passthroughParams as well?

keyserver/src/uploads/uploads.js
203 ↗(On Diff #26438)

I think you accidentally left this sleep(3000) in?

lib/actions/upload-actions.js
17–22 ↗(On Diff #26438)
  1. Since it's already wrapped in Shape, the ? should not be necessary (but let me know if I'm missing something)
  2. Should we make this read-only?
This revision now requires changes to proceed.May 15 2023, 12:34 PM
keyserver/src/uploads/media-utils.js
71 ↗(On Diff #26438)

inputLoop can be added, for inputDimensions Flow complains (multiple tuple types)

keyserver/src/uploads/uploads.js
203 ↗(On Diff #26438)

My bad

lib/actions/upload-actions.js
17–22 ↗(On Diff #26438)
  1. Yes, you're right
  1. I think Shape already makes object read-only, that's why it wasn't read-only at first place
export type Shape<O> = $ReadOnly<$Rest<O, { ... }>>;

Removed accidental sleep. Updated types as suggested

ashoat added inline comments.
lib/actions/upload-actions.js
21 ↗(On Diff #26503)

Not sure the ? is necessary here – I thought Shape handles this, but I could be wrong

This revision is now accepted and ready to land.May 16 2023, 6:00 AM