Page MenuHomePhabricator

[lib] Introduce encrypted media types
ClosedPublic

Authored by bartek on Mar 24 2023, 4:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 10:30 PM
Unknown Object (File)
Sat, Apr 27, 10:29 PM
Unknown Object (File)
Sat, Apr 27, 10:29 PM
Unknown Object (File)
Sat, Apr 27, 10:29 PM
Unknown Object (File)
Sat, Apr 27, 10:29 PM
Unknown Object (File)
Sat, Apr 27, 10:29 PM
Unknown Object (File)
Sat, Apr 27, 10:29 PM
Unknown Object (File)
Sat, Apr 27, 10:27 PM
Subscribers

Details

Summary

Linear task: ENG-386

Added types encrypted_photo and encrypted_video. The only difference is that instead of uri they contain holder and encryptionKey pair.

Added invariant in several places across codebase to indicate places that will be modified in subsequent diffs and to supress Flow errors

Test Plan

Flow doesn't complain. Web and Native don't throw, it is still possible to send unencrypted media messages

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.

Simplified if-else branching

bartek published this revision for review.Mar 24 2023, 5:31 AM

I think we should include localMediaSelection, but not sure if a future diff adds that

lib/types/media-types.js
24 ↗(On Diff #24067)

Can we add a comment explaining holder?

28 ↗(On Diff #24067)

We are we excluding localMediaSelection here?

44 ↗(On Diff #24067)

Can we add a comment explaining holder?

52 ↗(On Diff #24067)

We are we excluding localMediaSelection here?

This revision is now accepted and ready to land.Mar 24 2023, 11:54 AM
lib/types/media-types.js
24 ↗(On Diff #24067)

Sure! I'll add a short explanation

28 ↗(On Diff #24067)

The localMediaSelection is needed for retrying failed uploads, which will not be the case for encrypted media messages, because the encrypted media will replace the non-encrypted one only after a successful upload.

Added a short description for the holder field

lib/types/media-types.js
28 ↗(On Diff #24067)

Got it!

This revision was automatically updated to reflect the committed changes.
This revision is now accepted and ready to land.Mar 30 2023, 11:20 AM
This revision was automatically updated to reflect the committed changes.