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

DOM Exception when using OnDemandGrid and Observable Memory Store: Regression #701

Closed
wildcatcs opened this issue Aug 14, 2013 · 8 comments

Comments

@wildcatcs
Copy link

When using an Observable Memory store and updating the items quickly in the store AND sorting one of the columns in the grid the following DOM Exception occurs:

message: NotFoundError: DOM Exception 8
stack: "Error: An attempt was made to reference a Node in a context where it does not exist.
at declare.insertRow (http://dojofoundation.org/packages/dgrid/js/dgrid/List.js:597:11)
at inherited (http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/dojo.js.uncompressed.js:7205:30)
at declare.insertRow (http://dojofoundation.org/packages/dgrid/js/dgrid/_StoreMixin.js:206:16)
at declare.newRow (http://dojofoundation.org/packages/dgrid/js/dgrid/List.js:413:20)
at inherited (http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/dojo.js.uncompressed.js:7205:30)
at declare.newRow (http://dojofoundation.org/packages/dgrid/js/dgrid/_StoreMixin.js:333:16)
at observerIndex (http://dojofoundation.org/packages/dgrid/js/dgrid/List.js:497:18)
at http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/store/Observable.js:10:254
at when (http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/dojo.js.uncompressed.js:10982:23)
at Array.q.push.m.push.r (http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/store/Observable.js:9:180)"

image

This has been seen in both Firefox and Chrome. Once the exception occurs all further updates to the store causes "Uncaught Error: Query is out of date, you must observe() the query prior to any data modifications" exception in the dojo's Observable.

Here is the JSFiddle that generated the exception above:
http://jsfiddle.net/bvjQw/4/

To repeat run the example with javascript console open and sort by "year". It is non-deterministic so it some times takes a little while to show up (20-30 seconds). If it hasn't happened re-run the example and try again seems to be the fastest way to reproduce it (although, just leaving it running while sorted causes the error to show up).

The number of visible rows and the update rate for the items in the store does seem to effect how quickly the error occurs.

This error did not occur with dgrid 3.3.

@kfranqueiro
Copy link
Member

I actually didn't have luck reproducing the issue from the fiddle, but managed to reproduce it eventually by hooking up an additional setInterval to refresh the grid as well. After further reducing the test case, the issue came down to specifically modifying the 24th row directly after a refresh. This issue arises due to OnDemandList's overlapping of queries (which is an attempt to work around some issues with dojo/store/Observable dropping items at page boundaries).

I've managed to resolve the original regression, which occurred before 0.3.7, but am still seeing some related issues. This is the kind of thing where fixing one thing doesn't break another, but leads to another issue coming out of the woodwork. We'll have to spend more time on this, and it may require heavier refactoring than what I've done so far.

@wildcatcs
Copy link
Author

Glad to hear you could reproduce it. In the application I'm creating we are doing updates more along the lines of every 100ms and see it much more frequently than on the fiddle to the point that we can't upgrade to the lastest dgrid.

@rhpijnacker
Copy link

We are experiencing the same error. In our case it occurs when we update a list via multiple updates that are triggered via notification.

@tonnguyen
Copy link

I am experiencing the same error, when using grid.insertRow function, to add new row. It happens if we add new row in case have only one row in the grid.

@pariswd
Copy link

pariswd commented Nov 21, 2013

Has anyone come up with a workaround? I've tried a few workarounds that at best lead to reduced occurrence of the error, but I haven't figured out a workaround to eliminate it altogether.

I've read through the details in #714 hoping that understanding the internals of the problem would give me a clue about what I could change in my application to prevent the error, but so far no luck.

@kfranqueiro
Copy link
Member

This should now be resolved via commit 105e38b. Please let us know if you still have problems with observable notifications.

@jandppw
Copy link

jandppw commented Jan 15, 2014

Any guidance on when a release (0.3.13?) will occur with this fix included?

@kfranqueiro
Copy link
Member

The current plan is to tag a release near the end of January. The holiday season had a lull in activity, and we're hoping to review and include a couple of other improvements as well.

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

6 participants