Page MenuHomePhabricator

[lib] Introduce `translateMediaToClientDBMediaInfos`
ClosedPublic

Authored by atul on Oct 4 2022, 6:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 27, 4:22 AM
Unknown Object (File)
Wed, Jun 26, 3:29 PM
Unknown Object (File)
Mon, Jun 24, 11:01 AM
Unknown Object (File)
Sun, Jun 23, 5:26 PM
Unknown Object (File)
Sat, Jun 22, 3:12 AM
Unknown Object (File)
Fri, Jun 21, 8:47 AM
Unknown Object (File)
Mon, Jun 17, 2:53 AM
Unknown Object (File)
Mon, Jun 17, 2:52 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #17332)

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 ↗(On Diff #17332)

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.