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
Unknown Object (File)
Sat, Jul 20, 6:56 PM
Unknown Object (File)
Wed, Jul 10, 4:39 PM
Unknown Object (File)
Sun, Jul 7, 7:19 AM
Unknown Object (File)
Fri, Jul 5, 1:35 PM
Unknown Object (File)
Wed, Jul 3, 10:23 PM
Unknown Object (File)
Wed, Jul 3, 9:14 AM
Unknown Object (File)
Wed, Jul 3, 1:42 AM
Unknown Object (File)
Tue, Jul 2, 9:01 AM
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
Lint Not Applicable
Unit
Tests Not Applicable

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)