Opened 9 years ago

Closed 7 years ago

#11838 closed defect (wontfix)

CouchDBRestStore adding invalid item attributes after save

Reported by: andrealp99 Owned by: Kris Zyp
Priority: high Milestone: tbd
Component: DojoX Data Version: 1.5
Keywords: CouchDB Cc: alan.plante@…
Blocked By: Blocking:

Description

Using CouchDBRestStore, after the save of an updated document, the item has the return value attributes added to it; subsequent saves add those attributes to the doc in the db. Those invalid fields that are getting merged into the item from the return are ok, id, and rev. As far as I can tell, it looks like in dojox.rpc.JsonRest?.commit, it calls resolveJson which in turn calls dojox.json.ref.resolveJson and that code takes the return from Couch and merges it with the actual item. From that point on the item is carrying those additional fields.

I've attached a test below - you'll have to update the dojo paths. There is a list of steps at the top of the page.

Here's the info for the Couch setup: Database: bugtest Documents: {

"_id": "9b30c954174f65a2351af18a760000bc", "type": "person", "firstname": "John", "lastname": "Doe"

} and {

"_id": "9b30c954174f65a2351af18a76000a92", "_rev": "1-5ed1da20e4bf19810253d42f645ae96f", "type": "person", "firstname": "Foo", "lastname": "Bar"

}

A view in /bugtest/_design/bugtest/_view/getPeople: function(doc) {

if (doc.type == "person") {

emit(doc._id, doc);

}

}

Issue was seen on both FFX 3.6.10 and IE8, running on XP.

Attachments (1)

CouchDBRestStoreBug.html (3.6 KB) - added by andrealp99 9 years ago.
Test file

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by andrealp99

Attachment: CouchDBRestStoreBug.html added

Test file

comment:1 Changed 9 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to Kris Zyp

Your store too, Kris. :)

comment:2 Changed 7 years ago by Colin Snover

Resolution: wontfix
Status: newclosed

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.

Note: See TracTickets for help on using tickets.