Page MenuHomePhabricator

[lib] Inline reduceDeviceToken
ClosedPublic

Authored by inka on Nov 10 2023, 4:27 AM.
Tags
None
Referenced Files
F3373482: D9816.id33203.diff
Tue, Nov 26, 9:57 AM
F3371126: D9816.id33316.diff
Tue, Nov 26, 4:31 AM
F3370499: D9816.id33203.diff
Tue, Nov 26, 2:59 AM
Unknown Object (File)
Sun, Nov 24, 6:33 PM
Unknown Object (File)
Fri, Nov 22, 2:41 PM
Unknown Object (File)
Wed, Nov 6, 7:27 PM
Unknown Object (File)
Wed, Nov 6, 7:27 PM
Unknown Object (File)
Wed, Nov 6, 7:26 PM
Subscribers

Details

Summary

issue: https://linear.app/comm/issue/ENG-5652/inline-reducedevicetoken
See the deleted file for how it worked before

Test Plan

Dispatched incrementalStateSyncActionType, setDeviceTokenActionTypes actions, chcked that the state changes as expected

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Nov 10 2023, 4:45 AM
michal added inline comments.
lib/reducers/keyserver-reducer.js
330 ↗(On Diff #33203)

Nit: does this work?

This revision is now accepted and ready to land.Nov 14 2023, 6:11 AM
lib/reducers/keyserver-reducer.js
330 ↗(On Diff #33203)

No. This is a trick to strip KeyserverInfos of read-only on fileds, so that we can do the assignment in line 332.

Otherwise we get a flow error:

Cannot assign object literal to `keyserverInfos[keyserverID]` because an index signature declaring the expected key / value type is not writable.Flow(cannot-write)
lib/reducers/keyserver-reducer.js
137 ↗(On Diff #33316)

Nit: shorthand

This revision was automatically updated to reflect the committed changes.