Page MenuHomePhabricator

[keyserver] Introduce getInitialReduxStateResponder
ClosedPublic

Authored by michal on Sep 11 2023, 4:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 8, 3:31 AM
Unknown Object (File)
Thu, Apr 25, 12:32 PM
Unknown Object (File)
Apr 5 2024, 11:25 AM
Unknown Object (File)
Apr 5 2024, 11:25 AM
Unknown Object (File)
Apr 5 2024, 11:25 AM
Unknown Object (File)
Apr 5 2024, 11:24 AM
Unknown Object (File)
Apr 5 2024, 11:19 AM
Unknown Object (File)
Mar 2 2024, 9:29 PM
Subscribers

Details

Summary

ENG-4751
Depends on D9111

This diff creates the definition of the new getInitialReduxStateResponder. It takes URLInfo as the input, because we can generate it on the client, and that makes it more consistent with the rest of the responders. The output is modified from initial redux state in website responder:

  • removed all top-level fields which were always set to a default (except for commServicesAccessToken which I assume will be filled in here in the future)
  • instead of UserStore return UserInfos (the inconsistencyReports field is always set to default, so it will be set on client)
  • keyserverInfo contains only sessionID and updatesCurrentAsOf because:
    • cookie and lastCommunicatedPlatformDetails are persisted
    • connection is reset to default after reload
    • urlPrefix is set to default (and will be probably persisted later)

Also we only return keyserverInfo instead of a keyserverStore. To me it seems clearer that the keyserver only returns the data for itself, instead of the whole store. Assigning it to the ashoats keyserver data will be done on the client.

Test Plan

yarn flow

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil added inline comments.
keyserver/src/endpoints.js
565 ↗(On Diff #30915)

I think endpoints here are supposed to be in alphabetical order, but looks like lately this convention is no longer maintained

569 ↗(On Diff #30915)

tricky one - but shouldn't we add baseLegalPolicies? This endpoint will return tons of data so probably acknowledging policies is needed

lib/types/endpoints.js
44 ↗(On Diff #30915)

I think the type should be singular

This revision is now accepted and ready to land.Sep 12 2023, 1:11 AM
keyserver/src/endpoints.js
569 ↗(On Diff #30915)

Policies are handled inside the endpoint itself (like they are currently handled inside website-responders). As discussed in D9124 we should be able to fix this in the future.