Page MenuHomePhabricator

[lib] Replace merging entries with an ops approach
ClosedPublic

Authored by tomek on May 21 2024, 12:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 25, 3:30 PM
Unknown Object (File)
Wed, Dec 25, 2:46 PM
Unknown Object (File)
Mon, Dec 16, 5:23 PM
Unknown Object (File)
Mon, Dec 16, 5:22 PM
Unknown Object (File)
Mon, Dec 16, 5:22 PM
Unknown Object (File)
Mon, Dec 16, 5:22 PM
Unknown Object (File)
Mon, Dec 16, 5:22 PM
Unknown Object (File)
Wed, Dec 11, 5:43 PM
Subscribers

Details

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.

  1. To test fetchEntriesActionTypes.success: click history on a day in calendar on Web
  2. 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.
  3. To test saveEntryActionTypes.success: edit and save entry on web.
  4. To test deleteEntryActionTypes: delete entry and check in SQLite that deleted property is marked as true and entry is not visible across app restarts.
  5. To test restoreEntryActionTypes.success: Delete and restore on web. Reopen the app between steps, and ensure that changes are persisted.
  6. To test legacyLogInActionTypes.success, legacySiweAuthActionTypes.success, keyserverAuthActionTypes.success: log in and log out and seeing that entries are in db after logging in back.
  7. To test incrementalStateSyncActionType: background mobile app, do something in calendar on web and foreground the app again.
  8. To test processUpdatesActionType, joinThreadActionTypes.success, newThreadActionTypes.success: modify entry on web and see immediate update (UI and DB) on native.
  9. 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.
  10. To test processServerRequestsActionType: This actions is dispatched a short while after creating entry when it transitions from local to remote.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek retitled this revision from [native] Replace merging entries with an ops approach to [lib] Replace merging entries with an ops approach.May 21 2024, 12:28 PM
Harbormaster returned this revision to the author for changes because remote builds failed.May 21 2024, 12:40 PM
Harbormaster failed remote builds in B29131: Diff 40499!
tomek requested review of this revision.May 21 2024, 1:12 PM
lib/reducers/entry-reducer.js
287 ↗(On Diff #40511)

Tested works. Tested by clicking history on calendar entry in Web.

313 ↗(On Diff #40511)

Tested works. Tested by creating 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.

340 ↗(On Diff #40511)

Tested works. Tested by creating entry and ensuring that it appears in the DB immediately and has local id

407 ↗(On Diff #40511)

Tested works. Tested by editing and saving entry on web.

488 ↗(On Diff #40511)

Tested. Works. Tested by deleting entry and checking in SQLite that deleted property is marked and entry is not visible across app restarts.

537 ↗(On Diff #40511)

Tested works. Deleted and restored on web. Reopened app between steps,

552 ↗(On Diff #40511)

Tested works. Tested by logging in and logging out and seeing that entries are in db after logging in.

lib/reducers/entry-reducer.js
598 ↗(On Diff #40511)

Tested works. Tested by modifying entry on web and seeing immediate update (UI and DB) on native.

lib/reducers/entry-reducer.js
716 ↗(On Diff #40511)

Tested works. Texted by restarting the app and seeing that entries are in calendar.

lib/reducers/entry-reducer.js
626 ↗(On Diff #40511)

Tested works. Created community as user A, added user B, created entry and deleted user B. Checked that entry disappeared from B database.

lib/reducers/entry-reducer.js
574 ↗(On Diff #40511)

Tested works. Tested by backgrounding mobile app, doing something in calendar on web and foregrounding the app again.

lib/reducers/entry-reducer.js
655 ↗(On Diff #40511)

Tested works. This actions is dispatched a short while after creating entry when it transitions from local to remote.

lib/reducers/entry-reducer.js
614 ↗(On Diff #40511)

Tested works. I had to hack it. I went to socket.js in keyserver, changed condition in line 515 to be true, kill the native app, modify calendar on web an open the native app.

This revision is now accepted and ready to land.May 23 2024, 5:28 AM