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)
Mon, Sep 9, 10:41 AM
Unknown Object (File)
Mon, Sep 9, 10:41 AM
Unknown Object (File)
Mon, Sep 9, 10:40 AM
Unknown Object (File)
Mon, Sep 9, 10:08 AM
Unknown Object (File)
Aug 10 2024, 5:36 AM
Unknown Object (File)
Aug 10 2024, 5:36 AM
Unknown Object (File)
Aug 10 2024, 4:09 AM
Unknown Object (File)
Jul 25 2024, 2:22 PM
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