Page MenuHomePhabricator

[keyserver] Support encrypted media in create_multimedia_message
ClosedPublic

Authored by bartek on Apr 3 2023, 1:24 PM.
Tags
None
Referenced Files
F3514086: D7291.diff
Sun, Dec 22, 3:32 AM
Unknown Object (File)
Sat, Dec 14, 4:49 PM
Unknown Object (File)
Sat, Dec 14, 4:49 PM
Unknown Object (File)
Sat, Dec 14, 4:49 PM
Unknown Object (File)
Sat, Dec 14, 4:48 PM
Unknown Object (File)
Sat, Dec 14, 4:43 PM
Unknown Object (File)
Sat, Dec 7, 7:23 AM
Unknown Object (File)
Sat, Dec 7, 7:23 AM
Subscribers

Details

Summary

A few more changes needed for create_multimedia_message endpoint to properly handle encrypted multimedia. This was not needed for native, but is needed for web where message is created from pre-uploaded media.

Test Plan

Encrypted multimedia messages can be created from uploads having encryption key in upload extras.

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.Apr 3 2023, 2:41 PM

Looks good, minor nits inline.

keyserver/src/fetchers/upload-fetchers.js
109–120 ↗(On Diff #24583)

Let's handle the "easy case first" and "exit early" to improve the readability here a bit.

122–133 ↗(On Diff #24583)

Similar note as above.

135–140 ↗(On Diff #24583)

Not sure your thoughts on ternaries, but I'd prefer something like:

// $FlowFixMe add thumbnailID, thumbnailURI once they're in DB
return loop ? { ...video, loop } : video;
keyserver/src/responders/message-responders.js
203 ↗(On Diff #24583)

I know it's against our typical naming convention, but I wonder if something like:

forceMULTIMEDIAMessageType

would make it clearer that we're discussing messageTypes?

Just thinking out loud, feel free to land as-is.

This revision is now accepted and ready to land.Apr 4 2023, 9:49 AM
keyserver/src/responders/message-responders.js
203 ↗(On Diff #24583)

That would not be a bad idea, but this option is already landed in D7230

keyserver/src/fetchers/upload-fetchers.js
134

Just realized that this isn't addressed in a later diff in the stack. Wondering if there are any risks / issues with landing this to master, and whether we should be concerned about shipping the feature without this

keyserver/src/fetchers/upload-fetchers.js
134

Oh I guess this is just moved from the old version

keyserver/src/fetchers/upload-fetchers.js
134

This comment was here before my stack. This has no impact for now as we don't support sending video messages on web
cc @atul

keyserver/src/fetchers/upload-fetchers.js
134

Discussed this with @atul and came up with D7335 to clear things up