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)
Sun, Apr 14, 4:14 PM
Unknown Object (File)
Sat, Apr 13, 1:53 AM
Unknown Object (File)
Fri, Apr 12, 4:21 PM
Unknown Object (File)
Wed, Apr 10, 4:20 PM
Unknown Object (File)
Thu, Mar 28, 1:29 PM
Unknown Object (File)
Thu, Mar 28, 1:29 PM
Unknown Object (File)
Thu, Mar 28, 1:29 PM
Unknown Object (File)
Thu, Mar 28, 1:28 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.