You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a post and many comments exist and are stored offline.
When refreshing the page, the offline models are created, and no online models exist.
If refreshing only the post from the server (and returning the list of ids for the comments), the online store will create empty records for the comments, as it is not aware of any existing comments yet. These empty comments are then pushed to the offline server, overriding the old, correct, comments.
A solution: don't push to collection associations when the corresponding models are empty:
The text was updated successfully, but these errors were encountered:
Leooo
changed the title
Don't override the offlineStore records with empty records which were created on id-only relationships
Don't override the offlineStore records with empty records created on the online store due to id-only relationships fetched
Apr 30, 2015
a post and many comments exist and are stored offline.
When refreshing the page, the offline models are created, and no online models exist.
If refreshing only the post from the server (and returning the list of ids for the comments), the online store will create empty records for the comments, as it is not aware of any existing comments yet. These empty comments are then pushed to the offline server, overriding the old, correct, comments.
A solution: don't push to collection associations when the corresponding models are empty:
The text was updated successfully, but these errors were encountered: