Page MenuHomePhabricator

[lib] Migrate creating local entries, concurrent modification and delete entries actions to ops
ClosedPublic

Authored by tomek on May 21 2024, 12:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 6:19 PM
Unknown Object (File)
Tue, Dec 17, 3:31 PM
Unknown Object (File)
Mon, Dec 16, 5:23 PM
Unknown Object (File)
Mon, Dec 16, 5:23 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)
Sat, Dec 14, 1:28 PM
Subscribers

Details

Summary
Test Plan
  1. To test createLocalEntryActionType: create entry and ensuring that it appears in the DB immediately and has local id.
  2. To test createEntryActionTypes.success: create entry and wait after it transitions from local id to id in the db.
  3. To test concurrentModificationResetActionType: Hack. override save function of native/entry.react to dispatch this actions with hardcoded string. Ensure that no matter what you type the result after saving is always hardcoded string.
  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.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.May 21 2024, 1:17 PM
marcin requested changes to this revision.May 22 2024, 3:14 AM
marcin added inline comments.
lib/reducers/entry-reducer.js
339 ↗(On Diff #40512)

Creating local entry tested - works correctly.

360 ↗(On Diff #40512)

This one is buggy - you don't delete local entry first and what we see is two entries after a couple of seconds.

460 ↗(On Diff #40512)

Deleting tested - works correctly.

This revision now requires changes to proceed.May 22 2024, 3:14 AM

Delete local entry after successful creation

lib/reducers/entry-reducer.js
339 ↗(On Diff #40523)

Tested works. Creating entry results in immediate row in the db.

360 ↗(On Diff #40523)

Tested works. Tested by creating entry and waiting after it transitions from local id to id in the db.

lib/reducers/entry-reducer.js
438 ↗(On Diff #40523)

Tested works. I had to hack my way around this by overriding save function of native/entry.react to dispatch this actions with hardcoded string. No matter what I was typing the result after saving was always hardcoded string.

This revision is now accepted and ready to land.May 23 2024, 4:47 AM
marcin edited the test plan for this revision. (Show Details)