Page MenuHomePhabricator

[lib] Introduce encrypted media types
ClosedPublic

Authored by bartek on Mar 24 2023, 4:10 AM.
Tags
None
Referenced Files
F3516737: D7168.id24433.diff
Sun, Dec 22, 3:20 PM
F3516655: D7168.id24110.diff
Sun, Dec 22, 3:05 PM
F3516536: D7168.id24425.diff
Sun, Dec 22, 2:51 PM
F3516404: D7168.id24066.diff
Sun, Dec 22, 2:19 PM
F3516380: D7168.id24401.diff
Sun, Dec 22, 2:10 PM
F3516377: D7168.id24067.diff
Sun, Dec 22, 2:09 PM
F3515593: D7168.diff
Sun, Dec 22, 9:17 AM
Unknown Object (File)
Thu, Dec 5, 8:30 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
Lint Not Applicable
Unit
Tests Not Applicable

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.