Opened 8 years ago

Last modified 7 years ago

#15303 closed defect

JsonRestStore accepts items from different store — at Version 1

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

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 (1)

comment:1 Changed 8 years ago by haysmark

Description: modified (diff)
Note: See TracTickets for help on using tickets.