Opened 8 years ago

Closed 7 years ago

#12704 closed defect (wontfix)

Deleted item remains in cache when using JsonRestStore and ClientFilter

Reported by: ant Owned by: Kris Zyp
Priority: blocker Milestone: 1.9
Component: DojoX Data Version: 1.4.3
Keywords: Cc:
Blocked By: Blocking:

Description

I have having some problems with deleting items that use referencing from JsonRestStore? when used with ClientFilter?.

I am using Dojo 1.4.3 (21629). The problem is happening in all browsers I use(IE 8.06001.18702, Firefox 3.6.16, Chrome 10.0.648.204). OS is Windows XP SP 3.

Problem: Let say I have three JsonRestStores? namely resourceStore, resourceToConfigurationStore,and configurationStore. Code used to create the datastores are similar to the one listed below. Items in resourceStore and configurationStore stores do not use reference. Items in store resourceToConfigurationStore reference to items in A and C. There is an example of a item on the resourceToConfigurationStore below in step 1. Also there is one Datagrid for each JsonRestStore? and buttons allowing user to add/remove items to each grid.

To reproduce the bug,

  1. Add a new instance to the resourceToConfigurationStore, let say it is

{"id": "3", "configuration": {"$ref": "\/configurations\/10"}, "resource": {"$ref": "\/resources\/20"}}

  1. Confirm a request is sent to the server, item created in the database, and it shows in the related datagrid.
  2. Delete the instance (id=3) from the resourceToConfigurationStore.
  3. Confirm the request is send to the server and it is created in the database.
  4. Check the resourceToConfiguration datagrid to confirm the record is gone.
  5. Perform resourceToConfigurationStore.filter({}) to make sure the item with id=3 does not exist.
  6. Delete the configuration instance where id=10
  7. Confirm the configuration instance is gone from the grid and backend
  8. Now, notice that the deleted row re-appear in the datagrid for the resourceToConfigurationStore and it also re-appear in the result from resourceToConfigurationStore.filter({}).

Some sample code:

dojo.require("dojox.grid.DataGrid?"); dojo.require("dojox.data.ClientFilter?"); dojo.require("dojox.data.JsonRestStore?");

resourceStore = new dojox.data.JsonRestStore?({

target: targetURL, labelAttribute: "id", idAttribute: "id"

});

resourceGrid = new dojox.grid.DataGrid?({

store: resourceStore, structure: resourceGridLayout, selectionMode: "single", queryOptions:{cache:true, ignoreCase: true}, clientSort: true, rowsPerPage: 5, sortFields:[{attribute:'name'},{attribute:'version'}], updateDelay: 0, onSelectionChanged : function(){

var selected = resourceGrid.selection.getSelected(); dojo.publish("resource_selection_changed", [selected[0]]);

}

});

dojo.require("dojox.grid.DataGrid?"); dojo.require("dojox.data.ClientFilter?"); dojo.require("dojox.data.JsonRestStore?");

resourceStore = new dojox.data.JsonRestStore?({

target: targetURL, labelAttribute: "id", idAttribute: "id"

});

resourceGrid = new dojox.grid.DataGrid?({

store: resourceStore, structure: resourceGridLayout, selectionMode: "single", queryOptions:{cache:true, ignoreCase: true}, clientSort: true, rowsPerPage: 5, sortFields:[{attribute:'name'},{attribute:'version'}], updateDelay: 0, onSelectionChanged : function(){

var selected = resourceGrid.selection.getSelected(); dojo.publish("resource_selection_changed", [selected[0]]);

}

});

Note: I have also create another ticket #12703 that also uses these setup. The problem I have described here sounds similar to another ticket (#7743).

Change History (3)

comment:1 Changed 8 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to Kris Zyp

comment:2 Changed 8 years ago by Colin Snover

Priority: highblocker

Bulk update of open ticket priorities.

comment:3 Changed 7 years ago by dylan

Milestone: tbd1.9
Resolution: wontfix
Status: newclosed

Given the deprecation of dojo/data to instead use dojo/store, I'm closing this one out.

Note: See TracTickets for help on using tickets.