Page MenuHomePhabricator

[keyserver] Introduce getInitialReduxStateResponder
ClosedPublic

Authored by michal on Sep 11 2023, 4:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 24, 3:16 PM
Unknown Object (File)
Tue, Oct 22, 3:38 AM
Unknown Object (File)
Oct 2 2024, 10:41 PM
Unknown Object (File)
Sep 28 2024, 7:35 PM
Unknown Object (File)
Sep 28 2024, 7:35 PM
Unknown Object (File)
Sep 28 2024, 7:35 PM
Unknown Object (File)
Sep 28 2024, 7:35 PM
Unknown Object (File)
Sep 28 2024, 7:25 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.