Page MenuHomePhabricator

[lib] Introduce `translateMediaToClientDBMediaInfos`
ClosedPublic

Authored by atul on Oct 4 2022, 6:52 PM.
Tags
None
Referenced Files
F3520452: D5298.diff
Mon, Dec 23, 12:22 AM
F3516042: D5298.diff
Sun, Dec 22, 11:53 AM
Unknown Object (File)
Thu, Dec 19, 11:35 PM
Unknown Object (File)
Thu, Dec 19, 11:35 PM
Unknown Object (File)
Thu, Dec 19, 11:35 PM
Unknown Object (File)
Thu, Dec 19, 11:35 PM
Unknown Object (File)
Thu, Dec 19, 11:34 PM
Unknown Object (File)
Thu, Dec 19, 11:23 PM
Subscribers

Details

Summary

We previously had translateMediaToClientDBMediaInfo which gave us one ClientDBMediaInfo for each Media... but now the relationship between Media and "upload" is no longer 1:1.

translateMediaToClientDBMediaInfos replaces the existing function and returns an array with all of the ClientDBMediaInfos for a media message. By using this function in translateRawMessageInfoToClientDBMessageInfo we ensure that both the video and thumbnail are persisted in the media table of the SQLite "clientDB" database.

Test Plan

Ensured that both video and thumbnail are stored in SQLite media table for video messages:

b4d95a.png (262×2 px, 107 KB)

Also set breakpoints throughout to make sure values at different points were as expected.

Diff Detail

Repository
rCOMM Comm
Branch
arcpatch-D5241_1 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul requested review of this revision.Oct 4 2022, 7:03 PM
tomek added inline comments.
lib/utils/message-ops-utils.js
38

What this prop means and why it has the same value for video and its thumbnail?

This revision is now accepted and ready to land.Oct 5 2022, 2:01 AM
lib/utils/message-ops-utils.js
38

It's a prop included for local media within media messages in redux. It is, however, redundant to include for both the "primary media" and "thumbnail" so I'll remove it from here before landing

This revision was landed with ongoing or failed builds.Oct 5 2022, 8:31 AM
This revision was automatically updated to reflect the committed changes.