Page MenuHomePhabricator

[native] Create table and queries for DMOperations
ClosedPublic

Authored by tomek on Mon, Mar 17, 6:47 AM.
Tags
None
Referenced Files
F4953349: D14447.diff
Fri, Mar 21, 1:16 AM
F4953170: D14447.id47412.diff
Fri, Mar 21, 12:22 AM
F4953121: D14447.id.diff
Thu, Mar 20, 11:54 PM
F4950833: D14447.diff
Thu, Mar 20, 10:27 AM
Unknown Object (File)
Wed, Mar 19, 9:06 PM
Unknown Object (File)
Mon, Mar 17, 8:25 AM
Subscribers

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
No Lint Coverage
Unit
No Test Coverage

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

nit: to follow convention

native/cpp/CommonCpp/DatabaseManagers/entities/DMOperation.h
7–8

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