Page MenuHomePhabricator

[native] Create table and queries for DMOperations
ClosedPublic

Authored by tomek on Mon, Mar 17, 6:47 AM.

Details

Summary

Create a table where the operations are stored and allow quick query by the operation type.

https://linear.app/comm/issue/ENG-10333/create-sqlite-table-and-queries

Test Plan

Tested the whole stack on both native and web:

  1. Run the app on Redux version 86 with a modification to processDMOperation making all the INBOUND messages unsupported
  2. On one platform created a thread and sent a text message. These were visible on the sender, and invisible on the recipient
  3. Closed the recipient and added a migration that unshimms the thread creation operations, e.g.
unshimDMOperations(
  state,
  dmOperationTypes.CREATE_THREAD,
  handleReduxMigrationFailure,
): MigrationFunction<WebNavInfo, AppState>),
  1. Run the recipient and noticed the thread appearing
  2. Added another migration, this time unshimming text messages
  3. Run the recipient and noticed messages appearing

Additionally, tested the migration on native by removing the table from the code that creates the DB, bumping the version to make sure that the migration is run, and adding some code in JS that queries the table.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Mon, Mar 17, 6:58 AM
Harbormaster failed remote builds in B33723: Diff 47412!
Harbormaster returned this revision to the author for changes because remote builds failed.Mon, Mar 17, 7:57 AM
Harbormaster failed remote builds in B33735: Diff 47425!
tomek requested review of this revision.Tue, Mar 18, 3:42 AM
kamil added inline comments.
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
1032 ↗(On Diff #47425)

nit: to follow convention

native/cpp/CommonCpp/DatabaseManagers/entities/DMOperation.h
7–8 ↗(On Diff #47425)

I would add a newline here but in the codebase we use both

This revision is now accepted and ready to land.Tue, Mar 18, 7:31 AM