PaulUithol/Backbone-relational — Issue #83: References seem to be lost on deep data
Author: adamscybot
Created: 2012-02-27 17:48:09+00:00
State: open

I'm coming a cross a very frustrating problem. I have 3 views:

ParentView
ChildView
SubChildView

Upon the initial GET, the parent view creates the child views with a model. The child view then iterates over further nested data and creates sub child views with its model.

When I do a fetch at the parentView.model level, the reference for the models attached to the childviews seems to work (the updated information received from the fetch can be seen when doing childView.model). However, information updated further down the tree is not reflected in the SubChildViews model references. I.e. doing a subChildView.model will show old data. The cid for these models differs from the cid to the one contained within the relevant ChildView.model.

Surely when the parentView is updated, the original CIDs should be retained and all the references are the same. At the moment doing a fetch() seems to discard the original deeply nested models and creates new ones instead of updating them. This means references are old.