-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[BUGFIX release] Guard against isDestroyed in ManyArray.flushCanonical #3559
Conversation
Hey @jgwhite adding a test for this would be great! |
f2baf28
to
5e63ff2
Compare
@bmac test case added. The circumstances are kinda weird but it’s something I managed to run into in day-to-day development. I haven’t been able to go deeper on why a dead ManyArray is being referenced after unload but hopefully the test will help narrow it down. |
Currently updating the test to new JSON API style. |
Also just noticed I accidentally committed some changes further up in the file — my bad, was in a rush! |
5e63ff2
to
0e4e937
Compare
@bmac okay, now this is ready for review 😁 |
@igorT can you review this pr? |
@jgwhite could you try if this makes this test #3084 (comment) pass ? |
ping @igorT |
what's the status on this? |
0e4e937
to
251a06e
Compare
@sly7-7 just ran this patch against the test case in your comment and it does not fix it. |
Just rebased. |
can this be merged? |
+1 |
+1 |
@jgwhite I'm inclined to merge this. There's a few things that need to happen before that can happen:
|
@fivetanley thanks for the guidance. I’ll make time to address those points today. |
@@ -80,7 +80,9 @@ export default Ember.Object.extend(Ember.MutableArray, Ember.Evented, { | |||
toSet = toSet.concat(newRecords); | |||
var oldLength = this.length; | |||
this.arrayContentWillChange(0, this.length, toSet.length); | |||
this.set('length', toSet.length); | |||
if (!this.isDestroyed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also consider adding this.isDestroying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pangratz even better, thanks!
251a06e
to
fc85604
Compare
fc85604
to
d3f37c3
Compare
@fivetanley not quite as quick as promised but points addressed and ready for another review :) |
Looks like AppVeyor crashed with |
maybe something sideways here ? will kick the appveyor build.. |
[BUGFIX release] Guard against isDestroyed in ManyArray.flushCanonical
Thanks @jgwhite |
😄 |
Addresses #3084
This is the simplest-possible-patch I could find to get around a real pain point for unloading records. It looks like you guys are doing more fundamental work to address this but I wonder if we could put a fix like this in place as a stopgap.
If it’s needless and the real fix is about to land, I totally understand. If you think it is worthwhile I’ll flesh it out and add tests.