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 bill)

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:

  1. add a couple of node either by dnd or by clicking the create button. You should see on the console two transactions logged
  2. do it a couple of times to convince yourself that it works
  3. select a node and delete
  4. 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)
  5. 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)

onepost.html (14.0 KB) - added by Jean-Rubin Leonard 10 years ago.

Download all attachments as: .zip

Change History (9)

Changed 10 years ago by Jean-Rubin Leonard

Attachment: onepost.html added

comment:1 Changed 10 years ago by bill

Description: modified (diff)

comment:2 Changed 10 years ago by bill

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?

comment:3 Changed 10 years ago by Jean-Rubin Leonard

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 dante

Owner: set to Kris Zyp

comment:5 Changed 10 years ago by bill

Milestone: tbd1.5

comment:6 Changed 9 years ago by bill

Milestone: 1.51.6

1.5 is released, moving remaining tickets to 1.6

comment:7 Changed 8 years ago by bill

Milestone: 1.61.7

comment:8 Changed 8 years ago by bill

Resolution: invalid
Status: newclosed

Closing since test file was apparently never updated, or at least the update doesn't show up in this ticket history.

Note: See TracTickets for help on using tickets.