BlairAllegroTech / js-data-jsonapi

JsonApi Adapter for js-data
MIT License
15 stars 5 forks source link

Break js-data relations when JsonApi related data changes or becomes Null or Empty #10

Open BlairAllegroTech opened 8 years ago

BlairAllegroTech commented 8 years ago

js-data maintains data relationships.

If however other changes are being made against the server and we then request a resource that subsequently returns relationship data that differs from the js-data data store, we should try to update the datastore to keep it in sync?

Should we try to do this or leave to the developer to keep things in sync ?? See also #9

Cases:

BlairAllegroTech commented 7 years ago

Related to #42

rgant commented 7 years ago

I definitely think that the server is the source of truth and so if we get differing information back from the server then js-data should respect that.

I've recently had to add onConflict: 'replace' to my DS#save and DS#find calls so that it doesn't try to merge nested objects an create problems for my app.