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:
- I open up user
foo in AOR.
- User
foo joins a group bar in My app.
- My app creates a relation
users/foo/groups/bar in Firebase DB.
- I edit user
foo's name to "John Doe" in AOR.
- I hit save in AOR.
users/foo/groups/bar will be deleted from Firebase DB by AOR.
users/foo/name will be set to "John Doe" in Firebase DB by AOR.
- 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?
Right now we seem to be sending the entire record to Firebase's
updatefunction, instead of just the properties that have been updated in AOR. This could cause problems. To illustrate:fooin AOR.foojoins a groupbarin My app.users/foo/groups/barin Firebase DB.foo's name to "John Doe" in AOR.users/foo/groups/barwill be deleted from Firebase DB by AOR.users/foo/namewill be set to "John Doe" in Firebase DB by AOR.foois no longer a member of groupbarin my app.Could it be solved by a comparison of
params.previousDatavsparams.databefore posting to firebase, then posting only the fields that have been changed?