Page MenuHomePhabricator

[lib] Implement `messageContentForServerDB` for `messageTypes.MULTIMEDIA`
ClosedPublic

Authored by atul on Sep 20 2022, 9:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 28, 2:47 PM
Unknown Object (File)
Mon, Nov 25, 11:14 PM
Unknown Object (File)
Nov 22 2024, 1:06 PM
Unknown Object (File)
Nov 22 2024, 6:51 AM
Unknown Object (File)
Nov 18 2024, 10:41 AM
Unknown Object (File)
Nov 11 2024, 2:51 AM
Unknown Object (File)
Nov 10 2024, 12:27 PM
Unknown Object (File)
Nov 9 2024, 12:56 PM
Subscribers

Details

Summary

The messageContentForServerDB(...) function determines what gets put in the content column of the messages table.

The current content column for media messages is a "stringified" list of uploadIDs. However, the content column is never used after it's been stored in the DB. Rather, messages are joined with corresponding uploads via the container column of the uploads table. Therefore this change isn't "destructive."


Depends on D5195

Test Plan

Rows in the messages and uploads column appear as expected:

20a7c2.png (54×3 px, 66 KB)

8ddede.png (194×2 px, 214 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Sep 20 2022, 9:09 AM

I would reverse these conditions to overall reduce indentation level

EDIT

Never mind, it's cleaner in D5198. I probably would've submitted that first and this diff second

Is it safe for both server and client DB?

Should we have migrations on both platforms that update the values?

This revision is now accepted and ready to land.Sep 21 2022, 6:59 AM
In D5197#152670, @tomek wrote:

Is it safe for both server and client DB?

Should we have migrations on both platforms that update the values?

Yeah it's safe! There aren't any media messages in the database of type 15 (cc @ashoat who checked recently) so we're starting from a clean slate.

There certainly are issues if someone has video messages in their local environment, but that should only affect @abosh and I.