Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defaults on Firestore data and strategy for migrating types #88

Open
4 of 7 tasks
jsonnull opened this issue May 6, 2018 · 0 comments
Open
4 of 7 tasks

Defaults on Firestore data and strategy for migrating types #88

jsonnull opened this issue May 6, 2018 · 0 comments

Comments

@jsonnull
Copy link
Owner

jsonnull commented May 6, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant