HomePhabricator
Diffusion Comm e40c4596154a

[lib] Introduce `translateMediaToClientDBMediaInfos`

Description

[lib] Introduce translateMediaToClientDBMediaInfos

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.

Reviewers: tomek, marcin, abosh, rohan, ginsu

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D5298

Details

Provenance
atulAuthored on Oct 5 2022, 8:21 AM
Reviewer
tomek
Differential Revision
D5298: [lib] Introduce `translateMediaToClientDBMediaInfos`
Parents
rCOMM2e9ead6b523e: [CommCoreModule] Cut extraneous `include`s
Branches
Unknown
Tags
Unknown