Page MenuHomePhabricator

[lib] Refactor draft reducer
ClosedPublic

Authored by inka on Jan 15 2024, 9:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 6:42 AM
Unknown Object (File)
Tue, Nov 26, 2:28 AM
Unknown Object (File)
Tue, Nov 12, 3:28 PM
Unknown Object (File)
Mon, Nov 11, 1:28 AM
Unknown Object (File)
Fri, Nov 8, 12:03 AM
Unknown Object (File)
Thu, Nov 7, 7:55 PM
Unknown Object (File)
Thu, Nov 7, 5:45 AM
Unknown Object (File)
Thu, Nov 7, 4:33 AM
Subscribers

Details

Summary

issue: ENG-5812
We want to remove drafts of threads related to the keyservers the action was dispatched for

Test Plan

Ran the provided test, tested that when a user logs out the drafts are deleted

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

inka requested review of this revision.Jan 15 2024, 9:24 AM
This revision is now accepted and ready to land.Jan 16 2024, 7:17 AM
lib/reducers/draft-reducer.js
50 ↗(On Diff #35638)

As mentioned in other diffs, not sure we need to change anything for logOutActionTypes.success

inka planned changes to this revision.Jan 17 2024, 8:51 AM

We decided to have a single action for logging out of keyservers and identity.

This revision is now accepted and ready to land.Jan 18 2024, 1:50 AM
inka requested review of this revision.Jan 18 2024, 1:51 AM
lib/reducers/draft-reducer.js
59 ↗(On Diff #35772)

Why do we remove drafts from store on keyserver auth?

lib/reducers/draft-reducer.js
59 ↗(On Diff #35772)

We remove most data on keyserver login and set new session. I was mirroring this by removing data related to the keyserver the user has logged in to using keyserverAuthActionTypes.
I can see that we don't remove drafts on logInActionTypes, but I think this is by accident? I don't see why would want to treat drafts differently than other data

Merge identity delete account with keyserver delete account

lib/reducers/draft-reducer.js
59 ↗(On Diff #35772)

Because drafts are local-only and are not provided by the keyserver on login. Let's avoid removing drafts from the store on keyserver auth

Don't remove drafts on keyserver auth

This revision is now accepted and ready to land.Jan 24 2024, 11:31 AM
This revision was automatically updated to reflect the committed changes.