PDA

View Full Version : Destroyed Record in Store... immediately after removing



FBNitro
14 Jul 2015, 10:13 AM
Does anyone know why I would have a destroyed record showing up in a store?

I did a store.remove(record), which is triggering my grouping function. In the grouper, I see the following record which I just removed:
52845

Gary Schlosberg
14 Jul 2015, 11:04 AM
Thanks for the report. Difficult for me to say without seeing the code. Can you please post a test case which reproduces this issue?
https://fiddle.sencha.com/#home

FBNitro
17 Jul 2015, 2:27 PM
I'll try writing a fiddle next week. I'm working with a rather large app. It's not happy right now, lots of these 'destroyed' records not getting cleaned up at the moment.

We do some funky stuff with records in 2 stores and tracking the store events add/remove etc to clean it up. Maybe I'll try duplicating that code into a fiddle to see if that's causing it.

I had a few issues with this on the preview/beta, but it seems worse now.

FBNitro
20 Jul 2015, 2:58 PM
Thanks for the report. Difficult for me to say without seeing the code. Can you please post a test case which reproduces this issue?
https://fiddle.sencha.com/#home

Well, I spent the whole day trying to get a fiddle together that would do this. I have yet to succeed.

Do you have any hints/suggestions as to what to look for? I found where we called the destroy, tried removing that. Now instead of having a destroyed record in the store, I have a non-destroyed record being added back into the store after the store.remove(record), without any code that I can find to actually do the add.

evant
20 Jul 2015, 8:17 PM
Try putting a break point in onCollectionAdd in Store.js.

FBNitro
21 Jul 2015, 8:10 AM
Try putting a break point in onCollectionAdd in Store.js.

Thanks evant. It wasn't onCollectionAdd that was putting it in, it was onCollectionFilterAdd.

I've traced it down to the filter on the second (clone) store. The filter running immediately after the remove due to a sync that was put in. So I'll figure it out from here. At least I know the source of the insert now. Thanks.