fleet
fleet copied to clipboard
Investigate the effects of zero values in derived fields
Many objects in our API are returned with "derived" fields. Queries and packs are returned with the ID's and names of their creators, etc. If the user, for whatever reason, can't be found however, the name "none" is used and the id 0 is used. This doesn't really make sense and might cause interesting problems when those values are wholesale used to reference a complete set of users in redux or something. We need to make sure that fields like AuthorName
, AuthorID
, CreatedBy
, etc. never have invalid values.
FWIW, I think this is less of a problem in reality because any of the service endpoints we get Viewer context data in is an authenticated endpoint, which means the User and Session in the viewer are already enforced by middleware.