Opened 10 years ago
Closed 8 years ago
#10243 closed defect (invalid)
JSONRestStore does not send the proper number of requests
Reported by: | Jean-Rubin Leonard | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Dijit | Version: | 1.4.0b |
Keywords: | JSONRestStore tree dnd Put Post | Cc: | jrleonard@… |
Blocked By: | Blocking: |
Description (last modified by )
When we have a tree backed with a JSONRestStore, if we move a treenode from its position to another one (scenario 1) two operations happen and are sent to the server: a put (or a post with an id) is sent for the parent that lost the children. A second put (or post..) is sent to the server for the parent that gained a children. Upon altogether adding a new node to the tree (scenario 2), a new node is creating (generating a post to the server). That new node creation also generates a put that represents the change to the state of the parent to which the node was added. This usually works fine. I have had some issues however when only one of these operations are sent to the server. I have been able to reproduce the faulty behavior in the attached test case.
This is a fairly important issue. In my implementation for example, a tree node can only have one parent. If the put that notifies the server to remove the node from the parent that just lost a child is not send, the tree structure server side will become corrupted as the node won't be removed from its current parent but will be added to a new parent.
To reproduce the faulty behavior:
- add a couple of node either by dnd or by clicking the create button. You should see on the console two transactions logged
- do it a couple of times to convince yourself that it works
- select a node and delete
- dnd a tree node into another node you will see only one transaction has been sent to the server (in this case the service that i use to fake the server)
- If the faulty behavior doesnt happen please try step 3. I haven't been able to produce the behavior 100% of the time.
The behavior happens if we make an inner tree dnd (scenario 1) or dojo.dnd.Source dnd (scenario 2). It sometimes happen when we create a new node with the create button.
Unfortunately, I have not been able to pinpoint where the issue is (whether dnd modules, tree or store)
Attachments (1)
Change History (9)
Changed 10 years ago by
Attachment: | onepost.html added |
---|
comment:1 Changed 10 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
I just ran the test file myself and it's not even loading. It was working however two weeks ago when i created the test file. I will create another test file and submit but it might be a couple of days. JR
comment:4 Changed 10 years ago by
Owner: | set to Kris Zyp |
---|
comment:5 Changed 10 years ago by
Milestone: | tbd → 1.5 |
---|
comment:6 Changed 9 years ago by
Milestone: | 1.5 → 1.6 |
---|
1.5 is released, moving remaining tickets to 1.6
comment:7 Changed 9 years ago by
Milestone: | 1.6 → 1.7 |
---|
comment:8 Changed 8 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Closing since test file was apparently never updated, or at least the update doesn't show up in this ticket history.
I just tried the test case but it fails on the "create" button w/an error from dojox.rpc.JsonRest? that dfd.ioArgs is undefined. dfd is a Deferred object that is returned from your custom nswService.put() function. Presumably dojo.xhr() returns a deferred w/an ioArgs attribute, but your custom function does not?