Page MenuHomePhabricator

[lib] Introduce `reducePrimaryIdentityPublicKey` reducer
ClosedPublic

Authored by atul on Jan 28 2023, 3:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 9 2024, 10:39 AM
Unknown Object (File)
Apr 5 2024, 12:29 AM
Unknown Object (File)
Apr 5 2024, 12:29 AM
Unknown Object (File)
Apr 5 2024, 12:29 AM
Unknown Object (File)
Apr 5 2024, 12:29 AM
Unknown Object (File)
Apr 5 2024, 12:29 AM
Unknown Object (File)
Apr 5 2024, 12:29 AM
Unknown Object (File)
Apr 5 2024, 12:28 AM
Subscribers
None

Details

Summary

Introduce setPrimaryIdentityPublicKey action type and reducePrimaryIdentityPublicKey reducer.

setPrimaryIdentityPublicKey action will be dispatched in subsequent diffs to properly set the primaryIdentityPublicKey.


Depends on D6433

Test Plan

Will be tested by subsequent diffs/flow

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Jan 28 2023, 4:00 PM
atul edited the summary of this revision. (Show Details)
ashoat requested changes to this revision.Jan 28 2023, 5:30 PM
ashoat added inline comments.
lib/reducers/primary-identity-public-key-reducer.js
10 ↗(On Diff #21515)

I don't think we should introduce a reducer storing user data without handling logout, account deletion, and session invalidation

This revision now requires changes to proceed.Jan 28 2023, 5:30 PM

handle logout, account deletion, and session invalidation

hook up reducer to web/redux/redux-setup:reducer

add same sessionChange.cookieInvalidated check as reduceDeviceID

tomek added 1 blocking reviewer(s): ashoat.
tomek added inline comments.
web/redux/primary-identity-public-key-reducer.js
12 ↗(On Diff #21543)

I don't think we should mix default and named imports, especially when reducePrimaryIdentityPublicKey is already exported.

19–22 ↗(On Diff #21543)

We should create a function that contains all these checks - we use it ina lot of places and missing any of them might have serious consequences. Could you create a task for it?

ashoat added inline comments.
web/redux/primary-identity-public-key-reducer.js
12 ↗(On Diff #21543)

Agree with this

19–22 ↗(On Diff #21543)

I think Flow won't be able to properly handle typing eg. action.payload within the conditional if you use a function

This revision is now accepted and ready to land.Jan 30 2023, 9:47 AM
web/redux/primary-identity-public-key-reducer.js
12 ↗(On Diff #21543)

Yeah sorry, totally intended to cut the export default

web/redux/primary-identity-public-key-reducer.js
19–22 ↗(On Diff #21543)
This revision was landed with ongoing or failed builds.Jan 30 2023, 10:59 AM
This revision was automatically updated to reflect the committed changes.