Skip to content
This repository was archived by the owner on Jun 8, 2020. It is now read-only.

Overwrites externally modified data #27

@jjjjjjjjjjjjjjjjjjjj

Description

@jjjjjjjjjjjjjjjjjjjj

Right now we seem to be sending the entire record to Firebase's update function, instead of just the properties that have been updated in AOR. This could cause problems. To illustrate:

  1. I open up user foo in AOR.
  2. User foo joins a group bar in My app.
  3. My app creates a relation users/foo/groups/bar in Firebase DB.
  4. I edit user foo's name to "John Doe" in AOR.
  5. I hit save in AOR.
  6. users/foo/groups/bar will be deleted from Firebase DB by AOR.
  7. users/foo/name will be set to "John Doe" in Firebase DB by AOR.
  8. User foo is no longer a member of group bar in my app.

Could it be solved by a comparison of params.previousData vs params.data before posting to firebase, then posting only the fields that have been changed?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions