Page MenuHomePhabricator

[native] Avoid flicker when deleting during save/creation
ClosedPublic

Authored by ashoat on Jun 3 2024, 5:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 4:51 AM
Unknown Object (File)
Sat, Nov 16, 11:21 AM
Unknown Object (File)
Mon, Nov 11, 6:53 PM
Unknown Object (File)
Mon, Nov 11, 3:14 PM
Unknown Object (File)
Mon, Nov 11, 12:31 PM
Unknown Object (File)
Mon, Nov 11, 1:21 AM
Unknown Object (File)
Sat, Nov 2, 6:15 AM
Unknown Object (File)
Sat, Nov 2, 5:49 AM
Subscribers
None

Details

Summary

Because the DELETE_ENTRY_STARTED action gets dispatched inside the promises passed to dispatchActionPromise, it gets dispatched before the SAVE_ENTRY_SUCCESS / CREATE_ENTRY_SUCCESS.

This causes a flicker where the Entry "comes back from the dead". The issue is that DELETE_ENTRY_STARTED clears it initially (see entry-reducer.js), but then SAVE_ENTRY_SUCCESS / CREATE_ENTRY_SUCCESS unclear it, before DELETE_ENTRY_SUCCESS finally clears it (again).

This diff avoids the issue by making sure we dispatch SAVE_ENTRY_SUCCESS / CREATE_ENTRY_SUCCESS before DELETE_ENTRY_STARTED.

Depends on D12264

Test Plan

Test both deletion-during-creation and deletion-during-save and confirm that neither has a flicker anymore

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.Jun 3 2024, 5:30 AM
Harbormaster failed remote builds in B29359: Diff 40844!
ashoat requested review of this revision.Jun 3 2024, 6:28 AM
This revision is now accepted and ready to land.Jun 4 2024, 1:19 AM