Page MenuHomePhabricator

[keyserver] Introduce keyserver state sync spec
ClosedPublic

Authored by tomek on Aug 23 2023, 7:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 3:59 PM
Unknown Object (File)
Sun, Nov 10, 3:59 PM
Unknown Object (File)
Sun, Nov 10, 3:58 PM
Unknown Object (File)
Tue, Nov 5, 2:12 AM
Unknown Object (File)
Sep 28 2024, 10:31 AM
Unknown Object (File)
Sep 27 2024, 1:16 PM
Unknown Object (File)
Sep 27 2024, 1:16 PM
Unknown Object (File)
Sep 27 2024, 1:15 PM
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