Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.15.0 - unloadAll() not remove records from store #5175

Closed
amurchick opened this issue Sep 15, 2017 · 3 comments · Fixed by #5378
Closed

2.15.0 - unloadAll() not remove records from store #5175

amurchick opened this issue Sep 15, 2017 · 3 comments · Fixed by #5378

Comments

@amurchick
Copy link

DEBUG: -------------------------------
DEBUG: Ember      : 2.15.0
DEBUG: Ember Data : 2.15.0
DEBUG: jQuery     : 3.2.1
DEBUG: -------------------------------
> store.peekAll('directions').get('length')
0

> store.findAll('directions')
XHR finished loading: SEARCH "https://host.ru/api/v2/rest/directions".

> store.peekAll('directions').get('length')
2

>store.unloadAll()
undefined

> store.peekAll('directions').get('length')
2

But when unload record-by-record - all Ok:

> store.peekAll('directions').get('length')
0

> store.findAll('directions')
XHR finished loading: SEARCH "https://host.ru/api/v2/rest/directions".

> store.peekAll('directions').get('length')
2

> store.peekAll('directions').objectAt(0).unloadRecord()
undefined

> store.peekAll('directions').get('length')
1

>store.peekAll('directions').objectAt(0).unloadRecord()
undefined

> store.peekAll('directions').get('length')
0
@bantic
Copy link
Member

bantic commented Sep 15, 2017

#5167 is possibly related.

What if you wrap the unloadAll in a runloop? e.g.

Ember.run(() => store.unloadAll());

@catz
Copy link

catz commented Sep 25, 2017

Hello @bantic

unfortunately, wrapping doesn't help

@Kilowhisky
Copy link

This sounds exactly like #5111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants