Page MenuHomePhabricator

Add identity platform details to aux user store
ClosedPublic

Authored by marcin on Tue, Jun 4, 1:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 28, 6:49 PM
Unknown Object (File)
Fri, Jun 28, 11:57 AM
Unknown Object (File)
Thu, Jun 27, 5:18 AM
Unknown Object (File)
Wed, Jun 26, 5:46 AM
Unknown Object (File)
Sun, Jun 23, 9:33 PM
Unknown Object (File)
Sun, Jun 23, 8:22 PM
Unknown Object (File)
Sun, Jun 23, 2:51 PM
Unknown Object (File)
Sun, Jun 23, 1:02 AM
Subscribers

Details

Summary

This differential add identity platform details to aux user store and reducer

Test Plan

Flow. running reducer jest test.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

marcin requested review of this revision.Tue, Jun 4, 1:34 AM
lib/flow-typed/npm/tcomb_v3.x.x.js
122 ↗(On Diff #40920)

I assume you tested and confirmed that tcomb can actually support this, yeah?

lib/types/identity-service-types.js
333–336 ↗(On Diff #40920)

Why isn't this read-only?

lib/flow-typed/npm/tcomb_v3.x.x.js
122 ↗(On Diff #40920)

Further diffs in this stack use enums.of validator for array of numbers when returning identity response to JS. Additionally without this change flow complained when I used enums.of for array of numbers and after this change it was fixed. Do you think we need additional validation for this change?

lib/types/identity-service-types.js
333–336 ↗(On Diff #40920)

Clearly my oversight.

Make identity platform details type readonly

Those types are totally wrong. We need mapping from device id to platform details. Interestingly reducer worked as expected - it put map into the SQLite.

lib/flow-typed/npm/tcomb_v3.x.x.js
122 ↗(On Diff #40920)

If later diffs use this validator and it works, then I think that is sufficient for testing

Fix types. Use a map of [deviceID]: IdentityPlatformDetails

kamil added inline comments.
lib/types/aux-user-types.js
13 ↗(On Diff #40984)

worth noting that all keys in this map are values in the devices array in RawDeviceList above - wondering if there is a better way to type this structure

This revision is now accepted and ready to land.Thu, Jun 6, 1:23 AM
lib/types/aux-user-types.js
13 ↗(On Diff #40984)

I talked to @bartek about this and he would rather leave this type as it is. His reasons are:

  1. platofrmDetails property would need to be optional anyway since we can have device in device list for which we don't have platformDetails.
  2. In most cases we will only need the device list so having to do a map() each time we fetch data from aux_users would be less convenient.