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
I will admit I'm not 100% sure the source of this issue yet. I'm still trying to pinpoint the source, but there is definitely an issue so I figured I'd get this logged.
Here's an example of my data model: row.js module.exports = AmpersandModel.extend({ collections: { columns: Cells } }); cells.js module.exports = AmpersandCollection.extend({ indexes: ['columnDefinitionId'], model: Cell, }); cell.js module.exports = AmpersandModel.extend({ props: { id: ['number', false, null], columnDefinitionId: ['number', false, null], value: ['string', false, null], } });
When I call row.save(...) I'm seeing issues with the indexes of my cells collection. The indexes look good before, but not after collection.set(...) is invoked.
at some point, _reset is invoked, and at this point, indexes is no longer what I defined. It is an array (length 500, which seems absurdly large for a collection of ~5-6) that looks something like this:
once set has completed, my collection's _indexes looks like this:
As you can see, the cid and id indexes are rebuilt, but the columnDefinitionId index that I defined in my collection is not.
I've found this happens on save, but not fetch.
_addReference appears to be working properly, and, at the point this is invoked for each new model, the new cells are indexed properly.
Any help or insight here would be appreciated as this is creating a pretty major blocker for my project right now. Thanks!
The text was updated successfully, but these errors were encountered:
I will admit I'm not 100% sure the source of this issue yet. I'm still trying to pinpoint the source, but there is definitely an issue so I figured I'd get this logged.
Here's an example of my data model:
row.js
module.exports = AmpersandModel.extend({ collections: { columns: Cells } });
cells.js
module.exports = AmpersandCollection.extend({ indexes: ['columnDefinitionId'], model: Cell, });
cell.js
module.exports = AmpersandModel.extend({ props: { id: ['number', false, null], columnDefinitionId: ['number', false, null], value: ['string', false, null], } });
When I call
row.save(...)
I'm seeing issues with the indexes of my cells collection. The indexes look good before, but not aftercollection.set(...)
is invoked._reset
is invoked, and at this point,indexes
is no longer what I defined. It is an array (length 500, which seems absurdly large for a collection of ~5-6) that looks something like this:_indexes
looks like this:As you can see, the cid and id indexes are rebuilt, but the columnDefinitionId index that I defined in my collection is not.
_addReference
appears to be working properly, and, at the point this is invoked for each new model, the new cells are indexed properly.Any help or insight here would be appreciated as this is creating a pretty major blocker for my project right now. Thanks!
The text was updated successfully, but these errors were encountered: