Page MenuHomePhabricator

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

Authored by atul on Nov 15 2022, 10:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 2:36 AM
Unknown Object (File)
Tue, Nov 12, 1:51 AM
Unknown Object (File)
Mon, Nov 11, 3:56 AM
Unknown Object (File)
Sat, Nov 9, 6:53 PM
Unknown Object (File)
Sat, Nov 9, 2:34 PM
Unknown Object (File)
Sat, Nov 9, 10:30 AM
Unknown Object (File)
Sat, Nov 9, 9:08 AM
Unknown Object (File)
Mon, Nov 4, 8:18 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.