Page MenuHomePhabricator

[lib] Add hash functions to state sync spec
ClosedPublic

Authored by michal on Sep 29 2023, 5:20 AM.
Tags
None
Referenced Files
F2620490: D9327.diff
Fri, Sep 6, 12:07 PM
Unknown Object (File)
Fri, Aug 30, 2:50 PM
Unknown Object (File)
Thu, Aug 29, 12:14 AM
Unknown Object (File)
Wed, Aug 28, 8:54 AM
Unknown Object (File)
Tue, Aug 27, 11:40 AM
Unknown Object (File)
Tue, Aug 27, 8:07 AM
Unknown Object (File)
Tue, Aug 27, 1:59 AM
Unknown Object (File)
Sun, Aug 25, 10:16 PM
Subscribers

Details

Summary

Part of ENG-4959
Depends on D9267

Introduces new function to the sync spec: selector. It returns the spec with functions responsible for returning hashes for whole store, individual infos, and to return the list of all ids, using the current redux state. They will be used in the future diff instead of using the convertClientToServerInfos and hash.

Test Plan

yarn flow-all. Correctness of hashing is tested in the next diff.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek added inline comments.
lib/shared/state-sync/entries-state-sync-spec.js
45–53 ↗(On Diff #31544)

Do we have a plan on how it will look with multiple keyservers?

lib/shared/state-sync/state-sync-spec.js
30 ↗(On Diff #31544)

Why do we include StateSyncSpec inside the returned value?

This revision is now accepted and ready to land.Oct 3 2023, 3:25 AM

Update to new threadHashingStatus

lib/shared/state-sync/entries-state-sync-spec.js
45–53 ↗(On Diff #31544)

There's a few options:

  • just pass keyserver id as an argument to these functions
  • make the selector field be a function that takes a keyserver id and returns a selector for this specific keyserver

Probably depends on how we structure the websocket code around multiple keyservers

lib/shared/state-sync/state-sync-spec.js
30 ↗(On Diff #31544)

We still use the the hashKey, innerHashSpec fields in socket selector. Keeping them together with the hashing functions simplifies the code (see the next diff)