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)
Tue, Apr 30, 5:29 PM
Unknown Object (File)
Tue, Apr 30, 5:29 PM
Unknown Object (File)
Tue, Apr 30, 5:29 PM
Unknown Object (File)
Tue, Apr 30, 5:29 PM
Unknown Object (File)
Tue, Apr 30, 5:28 PM
Unknown Object (File)
Sun, Apr 28, 9:39 PM
Unknown Object (File)
Sun, Apr 28, 9:39 PM
Unknown Object (File)
Sun, Apr 28, 9:39 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
Branch
arcpatch-D5197 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

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.