Opened 8 years ago
Last modified 5 years ago
#17473 assigned defect
dojo.store.Cache not handling 304 with dojo.store.Memory
Reported by: | Frederic Canteloup | Owned by: | dylan |
---|---|---|---|
Priority: | undecided | Milestone: | 1.15 |
Component: | Data | Version: | 1.9.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Hi
When wrapping a Jsonrest, along with Memory store, into a Cache store, 304 returns from server are not handled properly upon updating entity. One gets : "TypeError?: Cannot use 'in' operator to search for 'key' in null" line 70 of uncompressed Memory.js file :
var id = object[idProperty] = (options && "id" in options) ? options.id : idProperty in object ? object[idProperty] : Math.random();
Thanks in advance for your help
Here is the code :
<script src="ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script>
<script>
require( [ 'dojo/parser', 'dojo/store/JsonRest', 'dojo/store/Memory', 'dojo/store/Cache' ], function(parser, JsonRest?, Memory, Cache) {
parser.parse().then(function(){
var cachedStore = new Cache(
new JsonRest?({
target: "/mypath", idProperty: "key"
}),
new Memory({idProperty:"key"})
);
cachedStore.get(1).then(function(entity){
cachedStore.put(entity);
});
});
});
</script>
Change History (3)
comment:1 Changed 8 years ago by
Component: | General → Data |
---|---|
Owner: | set to Kris Zyp |
comment:2 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|---|
Owner: | changed from Kris Zyp to dylan |
Status: | new → assigned |
comment:3 Changed 5 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.