Page MenuHomePhabricator

[keyserver] Introduce getInitialReduxStateResponder
ClosedPublic

Authored by michal on Sep 11 2023, 4:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 15, 4:20 PM
Unknown Object (File)
Fri, Nov 15, 5:53 AM
Unknown Object (File)
Mon, Nov 11, 3:37 PM
Unknown Object (File)
Fri, Nov 8, 11:06 AM
Unknown Object (File)
Fri, Nov 8, 12:28 AM
Unknown Object (File)
Fri, Nov 8, 12:27 AM
Unknown Object (File)
Fri, Nov 8, 12:27 AM
Unknown Object (File)
Fri, Nov 8, 12:08 AM
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
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil added inline comments.
keyserver/src/endpoints.js
565

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

569

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

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

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.