Page MenuHomePhabricator

[keyserver] Introduce keyserver state sync spec
ClosedPublic

Authored by tomek on Aug 23 2023, 7:13 AM.
Tags
None
Referenced Files
F2827965: D8927.id30574.diff
Fri, Sep 27, 1:16 PM
F2827964: D8927.id30254.diff
Fri, Sep 27, 1:16 PM
F2827906: D8927.id.diff
Fri, Sep 27, 1:15 PM
F2827682: D8927.diff
Fri, Sep 27, 1:01 PM
Unknown Object (File)
Sun, Sep 15, 4:57 PM
Unknown Object (File)
Wed, Sep 11, 12:38 PM
Unknown Object (File)
Wed, Sep 4, 11:41 AM
Unknown Object (File)
Sat, Aug 31, 3:17 AM
Subscribers

Details

Summary

Fetch functions require viewer as an argument, but Viewer is defined in keyserver - that's why we need to define this spec outside of lib.
Currently, we're accessing serverStateSyncSpecs props directly, but later in the stack this is going to be replaced by iterating over the specs.

https://linear.app/comm/issue/ENG-4631/migrate-checkstate-from-session-utils-to-a-spec

Depends on D8926

Test Plan

Modify threads, entries and users in the db and check if state check fixes client state. Also check if after fixing there are no invalidKeys.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

keyserver/src/shared/state-sync/entries-state-sync-spec.js
14 ↗(On Diff #30254)

I've moved serverEntryInfosObject here so that all the specs have a similar interface when hashes are computed.

keyserver/src/socket/session-utils.js
393 ↗(On Diff #30254)

This will be also needed for other if branches in this function.

bartek published this revision for review.Aug 23 2023, 12:55 PM
bartek added a subscriber: atul.

Looks like Phabricator went out of sync with Buildkite, cc @atul

The code is starting to look a lot better!

keyserver/src/shared/state-sync/state-sync-spec.js
10 ↗(On Diff #30254)

could you remind me, why calendarQuery can not be used from viewer object?

based on the call sites in this diff it's taken from the viewer anyway

This revision is now accepted and ready to land.Aug 24 2023, 3:17 PM
keyserver/src/shared/state-sync/state-sync-spec.js
10 ↗(On Diff #30254)

This is a really interesting observation - I don't know why we're using this pattern. I created a task https://linear.app/comm/issue/ENG-4822/consider-using-calendarquery-from-viewer-inside-state-sync-specs for it. This will be a big simplification.

This revision was landed with ongoing or failed builds.Aug 30 2023, 9:16 AM
This revision was automatically updated to reflect the committed changes.
keyserver/src/shared/state-sync/state-sync-specs.js
10

* is basically any and has been deprecated from Flow for a long time. Not sure there was a better solution here though

keyserver/src/shared/state-sync/state-sync-specs.js
10