pixiebrix-extension icon indicating copy to clipboard operation
pixiebrix-extension copied to clipboard

Review Required/Optional keys of `Me` and `UserData` type

Open fregante opened this issue 1 year ago • 4 comments

The types of Me seem to be incomplete. In the swagger file, no key is required, I don’t think this is the case in real life as actual users must be identified somehow, even if by a temporary UUID… right?

https://github.com/pixiebrix/pixiebrix-extension/blob/fe4f6abd4f36122129d5e4dce7cb74a2b8489b12/src/types/swagger.ts#L1187-L1194

The local Me type is specified at:

https://github.com/pixiebrix/pixiebrix-extension/blob/fe4f6abd4f36122129d5e4dce7cb74a2b8489b12/src/types/contract.ts#L62

UserData is likewise fully optional:

https://github.com/pixiebrix/pixiebrix-extension/blob/fe4f6abd4f36122129d5e4dce7cb74a2b8489b12/src/auth/authTypes.ts#L37

The biggest conflict I found is that in selectUserDataUpdate, the value of the return email is required, but the input is optional.

fregante avatar Feb 25 '24 08:02 fregante

Also see the notes in https://github.com/pixiebrix/pixiebrix-extension/pull/7667/files#r1495965976

In short, Required isn't enough and is still leaving null values behind.

fregante avatar Feb 25 '24 08:02 fregante

cc @BLoe

grahamlangford avatar Feb 26 '24 15:02 grahamlangford

I'm working on cleaning this stuff up right now, I'll link my PR when I get a draft up soon

BLoe avatar Feb 26 '24 17:02 BLoe

Related ticket: https://github.com/pixiebrix/pixiebrix-extension/issues/7757

BLoe avatar Feb 28 '24 20:02 BLoe

This issue will be closed in 7 days unless the stale label is removed, or a comment is added to the issue.

github-actions[bot] avatar May 29 '24 00:05 github-actions[bot]

This issue was closed because it has been stale for 7 days with no activity.

github-actions[bot] avatar Jun 06 '24 00:06 github-actions[bot]