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 2, 6:15 AM
Unknown Object (File)
Sat, Nov 2, 5:49 AM
Unknown Object (File)
Thu, Oct 10, 10:12 PM
Unknown Object (File)
Thu, Oct 10, 10:12 PM
Unknown Object (File)
Thu, Oct 10, 10:12 PM
Unknown Object (File)
Thu, Oct 10, 10:12 PM
Unknown Object (File)
Sep 28 2024, 8:22 PM
Unknown Object (File)
Sep 9 2024, 10:41 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
Lint Not Applicable
Unit
Tests Not Applicable

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