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

Cannot destroy and save in the same loop #4993

Closed
simonihmig opened this issue May 22, 2017 · 0 comments
Closed

Cannot destroy and save in the same loop #4993

simonihmig opened this issue May 22, 2017 · 0 comments

Comments

@simonihmig
Copy link
Contributor

When calling destroyRecord on any record, all following save calls (to other models), that are scheduled to flush in the same run loop, are never executed, their promises never resolve.

Here is a reproduction: https://ember-twiddle.com/bb59f15d60bc28e484ff32ac4407d347?openFiles=tests.unit.models.my-model-test.js%2C

I think I have found the reason, will try to come up with a PR to fix this...

simonihmig added a commit to simonihmig/data that referenced this issue May 22, 2017
simonihmig added a commit to simonihmig/data that referenced this issue May 27, 2017
bmac pushed a commit that referenced this issue Jun 19, 2017
surfacedamage pushed a commit to Aperta-project/Aperta that referenced this issue Oct 31, 2017
Ember Data 2.12 introduced a bug which prevents destroys and saves 
happening within the same run loop.  We had originally updated Ember to 
2.13 and then found this issue when testing repeaters which routinely 
destroy and save within the same run loop, thus exposing the problem.

Since this bug is subtle and may be present in unknown places elsewhere
in the codebase, it was determined that downgrading to 2.11.* makes the
most sense as a temporary fix until the project can eventually be updated
to the latest version of Ember Data.

We originally attempted upgrading to several NEWER version of Ember Data
(instead of downgrading), but there were many other test failures that
showed up and not enough time to fix the root causes, so this is a 
sensible temporary fix.

bug introduced = emberjs/data#4668
bug reported = emberjs/data#4993
bug fixed = emberjs/data#4994
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

No branches or pull requests

1 participant