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

Empty store at starting time won't be observed any more by OnDemandGrid #677

Closed
jankel opened this issue Jul 27, 2013 · 1 comment
Closed

Comments

@jankel
Copy link

jankel commented Jul 27, 2013

First of all big thanks for this excellent project and presently the work on the complex lifecycle of store observers!

Description

I ran into this issue by starting an OnDemandGrid with an empty („data: []“) Observable-wrapped-Memory-store. Any store-put's afterwards won't result into a grid-update, so the grid remains empty. Problem starts since dgrid #5775abd and is still present in #f505e13d.

Isolated testcase

Steps to reproduce (3 alternatives)

Conditions: present dgrid or commit at least #5775abd ­- and dojo v1.9.1), present Chromium or Firefox

  • dgrid testcase (dgrid/test/OnDemand.html):
    • below very first grid hit the „Set to empty store“-button, then
    • execute in console 'grid.store.put({id: 888888, col1: "non-observed-entry"})'.
    • Result: no new line is created, grid still shows the empty-msg.
    • Resorting by clicking any grid-header shows a new line and reveals the existance of a new entry in the (former empty) store
  • testcase above: watching grid automatically updates after 2 seconds. The lower grid won't display a new row. Watching console showing that observed store_empty.data has now one new item.
  • in general: create an OnDemandGrid with an empty Observable(Memory)-store and afterwards put an item to the store.

Expected result

Arrival of a new line in dgrid once an item of a former empty store is put towards it. In own testcase above this should happen after 2 seconds.

Guess

At first I thought it might has to do with the point, that the grid-observer of an empty store seems to be cancelled on starting-time since 5775abd, in detail:
the condition in List.js line 532 (in present commit f505e13) needs resolvedRows.length to be > 0 not to call whenError(), resulting itself in .cancel() of the saved observer.
But playing around with this condition line looks like this condition is not the solution and is quite important to prevent dom-failures, so I better keep my hands away from this higher logic...

Anybody, who can reproduce my problem? Or did I run into a funny mistake/misunderstanding? ;-) Thanks in advance for your time, jan

ghost pushed a commit that referenced this issue Jul 29, 2013
Position noDataNode between the two preload nodes to prevent issues later
when inserting new rows
@kfranqueiro
Copy link
Member

I've been able to reproduce your issue, and indeed it seems that perhaps removing observers for empty result sets was a bad move on my part. It was intended to fix a rare instance with OnDemandList where observers wouldn't be cleaned up, but we'll have to take another approach to that issue.

I think I've fixed the issue you've outlined above. However, there's still a related issue due to the improved observer cleanup logic that if you start with items, remove all of them, and then add a new one, there are no observers left to report new rows being added. We'll continue to look into this; I guess our latest pass on cleaning up observers is doing its job too well... ;)

This issue was closed.
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

2 participants