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)
Sun, Nov 10, 12:58 PM
Unknown Object (File)
Thu, Oct 31, 1:04 PM
Unknown Object (File)
Thu, Oct 31, 1:04 PM
Unknown Object (File)
Tue, Oct 29, 1:37 PM
Unknown Object (File)
Oct 1 2024, 4:03 PM
Unknown Object (File)
Oct 1 2024, 4:03 PM
Unknown Object (File)
Oct 1 2024, 4:03 PM
Unknown Object (File)
Oct 1 2024, 4:03 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)