# This.store.push(data) inserts duplicate objects into the store cache

**URL:** <https://discuss.emberjs.com/t/this-store-push-data-inserts-duplicate-objects-into-the-store-cache/12342>\
**Category:** Uncategorized\
**Created:** [January 31, 2017, 1:12am UTC](https://discuss.emberjs.com/t/this-store-push-data-inserts-duplicate-objects-into-the-store-cache/12342 "2017-01-31T01:12:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gattra](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/gattra/32/12352_2.png) [@gattra](https://discuss.emberjs.com/u/gattra)\
**Post date:** [January 31, 2017, 1:12am UTC](https://discuss.emberjs.com/t/this-store-push-data-inserts-duplicate-objects-into-the-store-cache/12342/1 "2017-01-31T01:12:47Z")

</div>

```
this.modelFor('master.feed').get('feedTracks').removeObject(feedTrack);
this.store.findRecord('feed-track', feedTrack.id).then((ft) =>{
  ft.deleteRecord();
});

feedTrack.share().then((response) => {
if (response != null) {
    var normalizedResponse = this.store.normalize('feed-track', response);
    this.store.push(normalizedResponse);
});

```

The code above works as planned at first. The feedTrack record is removed from the array in the model. And the API returns a new object which is then pushed to the store.

But when the push occurs, the old feedTrack record that I had deleted, gets repopulated back into the association array.

It’s as if the `delete()` call never actually did anything and when the model detects a change, it reloads it.

Is this a bug or am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![broerse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/broerse/32/9497_2.png) [@broerse](https://discuss.emberjs.com/u/broerse)\
**Post date:** [January 31, 2017, 7:52am UTC](https://discuss.emberjs.com/t/this-store-push-data-inserts-duplicate-objects-into-the-store-cache/12342/2 "2017-01-31T07:52:10Z")

</div>

Perhaps it is related to the unsolved ember-data bug. My fix for now: [Temporary Fix for ember-data bug](https://discuss.emberjs.com/t/temporary-fix-for-ember-data-bug/12225/)

---

<div class="post-metadata">

**Author:** ![broerse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/broerse/32/9497_2.png) [@broerse](https://discuss.emberjs.com/u/broerse)\
**Post date:** [January 31, 2017, 7:53am UTC](https://discuss.emberjs.com/t/this-store-push-data-inserts-duplicate-objects-into-the-store-cache/12342/3 "2017-01-31T07:53:36Z")

</div>

See also: [GitHub - jlami/ember-bug-empty-data](https://github.com/jlami/ember-bug-empty-data)
