Opened 9 years ago
Closed 8 years ago
#15303 closed defect (wontfix)
JsonRestStore accepts items from different store
Reported by: | haysmark | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | DojoX Data | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
Consider the following JsonRestStore? code:
connect.connect(rpcRest._index,"onUpdate",this,function(obj,attrName,oldValue,newValue){ var prefix = this.service.servicePath; if(!obj.__id){ console.log("no id on updated object ", obj); }else if(obj.__id.substring(0,prefix.length) == prefix){ this.onSet(obj,attrName,oldValue,newValue); } });
That is: whenever dojox.rpc gets an onUpdate, call onSet if the start of the object's url matches this url.
The problem is that there may be different rest methods assigned to similar URLs. For example, imagine you have two stores: one pointing at rest method /A, and another at /A/B. Suppose you invoke POST /A/B/1. Because the item's URL matches both /A and /A/B, both stores will have onSet called even though only /A/B was updated.
Change History (3)
comment:1 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 9 years ago by
comment:3 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
dojox/data is abandoned. Some dojox/data stores have been upgraded to use the Dojo Store API and can be found at https://github.com/kfranqueiro/dojo-smore.
We should be able to improve the situation by also looking at the suffix, for instance:
This way the item would only match if the suffix contained precisely the object's id.