[lib] Replace merging entries with an ops approach
Summary:
Merging the entries now returns the ops which are later processed
Depends on D12156
https://linear.app/comm/issue/ENG-3486/move-entrystore-to-sqlite
Test Plan:
Be on the latest diff if this stack to ensure there is no mechanism from the keyserver that would aid entry persistence. After testing each actions kill the app and reopen it to ensure that changes are correctly persisted.
- To test fetchEntriesActionTypes.success: click history on a day in calendar on Web
- To test updateCalendarQueryActionTypes.success: create entry on web in a distant month in the past and then scrolling calendar in native to that date. Ensure that new entry appeared in the DB after scrolling close to the date.
- To test saveEntryActionTypes.success: edit and save entry on web.
- To test deleteEntryActionTypes: delete entry and check in SQLite that deleted property is marked as true and entry is not visible across app restarts.
- To test restoreEntryActionTypes.success: Delete and restore on web. Reopen the app between steps, and ensure that changes are persisted.
- To test legacyLogInActionTypes.success, legacySiweAuthActionTypes.success, keyserverAuthActionTypes.success: log in and log out and seeing that entries are in db after logging in back.
- To test incrementalStateSyncActionType: background mobile app, do something in calendar on web and foreground the app again.
- To test processUpdatesActionType, joinThreadActionTypes.success, newThreadActionTypes.success: modify entry on web and see immediate update (UI and DB) on native.
- To test fullStateSyncActionType by a hack: Go to socket.js in keyserver, change condition in line 515 to be true, kill the native app, modify calendar on web an open the native app.
- To test processServerRequestsActionType: This actions is dispatched a short while after creating entry when it transitions from local to remote.
Reviewers: kamil, marcin
Reviewed By: marcin
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D12162