Skip to content

Defaults on Firestore data and strategy for migrating types #88

@jsonnull

Description

@jsonnull

Right now we're prone to errors on the frontend when fields are added and expected to be present. There needs to be a way for users/games to migrate their data forward when new fields are added.

The strategy going forward will be to have the API respond with defaults for fields which are not present. To enforce this, we'll re-use Flow types currently referenced on the frontend (DBUser, DBProfile, etc.) to type the defaults values.

When entire documents are not present, the API should attempt to write a full set of defaults and then return this value. If this fails, a more specific error can be sent to the client than doc does not exist. I think this may only apply to user details like profiles, preferences, etc.

Add default types

  • User profile
  • User preferences
  • User games
  • Game info

Attempt to write defaults for users if not present

  • User profile
  • User preferences
  • User games

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions