HomePhabricator
Diffusion Comm b391db8d2f1b

[kesyerver][lib][native][web] Move actualizedCalendarQuery out of connection

Description

[kesyerver][lib][native][web] Move actualizedCalendarQuery out of connection

Summary:
issue: https://linear.app/comm/issue/ENG-4460/refactor-connection-field
We have code inside of reduceConnectionInfo that reduces connection field on rehydrateActionType action. It returns the default connection with the exception of actualizedCalendarQuery field, that we want to get rehydrated. Redux is implemented in such a way, that if the state returned after the rehydrate action is dispatched is not the rehydrated state, the rehydrated state is ignored. see source code for details: https://github.com/rt2zz/reduxpersist/blob/master/src/stateReconciler/autoMergeLevel1.ts#L23 https://github.com/rt2zz/redux-persist/blob/master/src/persistReducer.ts#L170.
This wasn't causing problems before, but we want to move connection field to keyserverStore. So changing the connection on rehydrate action causes the rest of keyserverStore to not get rehydrated.
Moreover, there is no point in having actualizedCalendarQuery inside of the keyserverStore - the query will be the same for all keyservers. There isn't even really a good reason why actualizedCalendarQuery was in the connection field in the first place, from what I can tell. It can be reduced completly independantly, and their use cases are quite different. So I'm moving actualizedCalendarQuery out of connection, and in next diffs I will

  1. Stop reducing connection on rehydrate action and instead remove it from persistence
  2. put the connection field inside of keyserverStore.

Test Plan:
Ran yarn flow-all, checked that the actualizedCalendarQuery is reduced and rehydrated correctly.
EDIT: tested the migration

Reviewers: michal, kamil

Reviewed By: michal

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D9018

Details

Provenance
inkaAuthored on Aug 30 2023, 2:26 AM
Reviewer
michal
Differential Revision
D9018: [kesyerver][lib][native][web] Move actualizedCalendarQuery out of connection
Parents
rCOMM925742213d52: [reports-service] Implement Blob storage
Branches
Unknown
Tags
Unknown