-
Notifications
You must be signed in to change notification settings - Fork 248
RangeError in ng-repeat #1121
Comments
Could you possibly try on master? This could be linked to a bug that was fixed in the change detection. |
@marc-hughes Cloud you also provide the html part and also describe the "specific action" (which causes the problem) in more details? |
@vicb What's the issue # you're referring to? |
Helper for repro case: https://github.com/matanlurey/ng-dart-repeat-bug. Only occurs in non-checked mode and dart2js. |
@markovuksanovic I suspect this is linked to 8dbeefc |
@vicb Yes, you're right... I did a bisect today and came to that same commit. Sorry, should have updated here. |
@vicb I've been running on master since Saturday and have not experienced the bug again. Like I mentioned, it was intermittent, but I'm very hopeful since normally I would have experienced the bug several times by now. @markovuksanovic While debugging this, I tried several variations, but even the simplest case of a div with nothing special on it caused the bug. Here are a few I know I tried:
The action was a drag & drop that would send a request to the server. Then in several pubnub messages back, it caused the underlying workers list to be modified. While debugging, I did try making a test case that would add/remove items in the same order, but did not experience the bug when running it. |
If the d&d modify the subject of ng-repeat the bug was probably caused by dropping past the last item, see #1097 for details |
#1097 looks very similar. Two potential differences: I was not actually modifying anything in the d&d handler, just firing off a server call. Some time later a response (realtime/pubnub, not http) would come back which would cause a modification to the list. The bug was occurring to me in dart/dartium code, not just in compiled js. |
#1097 does not only occur in JS but in non-checked mode (both JS & Dart) - I realized somewhere in the middle of the thread. This is one of the thing that made me think of this issue after @matanlurey comment. |
Since moving to the master branch on June 7, I have not experienced this bug again. I believe it is fixed. I'm not sure of your issue-closing policies. |
let's close this - reopen if you experience the defect again |
I get an intermittent RangeError in an ng-repeat. After it occurs, that ng-repeat stops updating for any future updates.
This is the stack trace:
The exception originates in this bit of code inside NgRepeat::onChange
Specifically, index ends up being >= the length of the _rows list.
Possible fix: I added in a check for that condition and bailed out when it happens.
This seems to fix my problem. No more exceptions, and the display correctly updates.
I'm three days into this bug now, nothing that I've changed in the application code has helped. I've spent most of a day trying to reproduce this in a simple test app, but haven't been able to.
A little background on the app... changes to the underlying list are happening due to messages received over a real-time pubnub channel. Sometimes, several updates could come in quickly one after one another. My guess, is there is some sort of race condition happening. Like I mentioned, it's intermittent. It only happens maybe 2% of the time when I'm performing a specific action in the app.
Originally found on 0.11, also occurs in 0.12
Running as dart code in dartium 34.0.1847.0
The text was updated successfully, but these errors were encountered: