Page MenuHomePhabricator

[native] Introduce migration to unshim `MULTIMEDIA` messages
ClosedPublic

Authored by atul on Nov 15 2022, 10:00 PM.
Tags
None
Referenced Files
F2167499: D5638.id18534.diff
Tue, Jul 2, 6:29 AM
Unknown Object (File)
Sat, Jun 29, 5:08 AM
Unknown Object (File)
Thu, Jun 27, 12:41 AM
Unknown Object (File)
Wed, Jun 26, 6:22 AM
Unknown Object (File)
Mon, Jun 24, 8:20 PM
Unknown Object (File)
Mon, Jun 24, 4:18 AM
Unknown Object (File)
Fri, Jun 21, 11:38 PM
Unknown Object (File)
Mon, Jun 17, 5:13 AM
Subscribers

Details

Summary

Context: https://linear.app/comm/issue/ENG-2270/handle-unshimming-of-multimedia-messages-on-native

This migration handles "unshimming" UNSUPPORTED messages that wrap MULTIMEDIA messages for clients upgrading from an old client to one that supports video messages.


Depends on D5637

Test Plan

Set breakpoints and ensured that values were as expected at each point.

  1. Sent video message to native client that didn't support video messages and observed UNSUPPORTED message in Redux that wrapped MULTIMEDIA message.

9a5b3f.png (928×1 px, 163 KB)

  1. Bumped Redux persist version to trigger migration.
  1. Observed that UNSUPPORTED message was replaced by "unshimmed` MULTIMEDIA message.

d90055.png (632×1 px, 112 KB)

I'll do a lot more additional testing before landing.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul attached a referenced file: F246215: d90055.png. (Show Details)
atul requested review of this revision.Nov 15 2022, 10:13 PM

Had a long argument with @atul about this... I think it's a really bad solution beacause it requires calling commCoreModule.getAllMessagesSync() a second time (first time is in SQLiteContextProvider) and because the logic here really has nothing to do with redux-persist.

I would've preferred doing this in C++, but Atul pointed out that would take a lot more time to write because the code we have for separating a RawMessageInfo (JS) into a message and a list of media (C++) only exists in JS today.

Another option would've been to do this in SQLiteContextProvider, but Atul's argument there was that we have no migrations mechanism in SQLiteContextProvider.

Our plan right now is to land this as-is and reevaluate at the end of the month if there is a better place we can put it. Atul estimates it would take 2-3 days to do this properly in the C++ side (ie. as a SQLite migration).

This revision is now accepted and ready to land.Nov 16 2022, 2:23 PM

Created Linear task to track reevaluating unshimming approach later in the month: https://linear.app/comm/issue/ENG-2281/reevaluate-multimedia-unshimming-approach

This revision was landed with ongoing or failed builds.Nov 17 2022, 10:09 AM
This revision was automatically updated to reflect the committed changes.