Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: SDK
-
Labels:None
-
Environment:iOS 5.1
Description
A document containing multiple attachments has an attachment deleted via the HTTP interface. The app subscribes to the HTTP _changes feed and receives the changed document. The incoming changed document lacks the _attachments property when received on the HTTP _changes feed, but this property is present on the couch cocoa _changes feed for the same change event.
The following is the sequence of app request/response events. Three events are shown, these being the _changes feed for the event prior to the attachment deletion, the attachment deletion itself and the _changes feed event that resulted from the attachment deletion. Requests and responses are shown taken from the browser on the simulator using iWebInspector.
Incoming change prior to the attachment deletion
Request URL:http://localhost.touchdb./forums/_changes?_dc=1351508886109&feed=longpoll&timeout=60000&include_docs=true&since=47230
Request Method:GET
Status Code:200 OK
Response
{
"results": [{
"seq": 47231,
"id": "ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb",
"doc": {
"sqlServerReplicationFlag": false,
"copy": null,
"personID": null,
"lastUpdated": null,
"type": "ThreadResponse",
"personName": null,
"syncStatus": ["Draft"],
"_id": "ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb",
"programmes": [],
"forumID": null,
"_rev": "6-249fb9928de2539b2debe763fdf276f3",
"created": null,
"videoFiles": [],
"_attachments": {
"third.png": {
"content_type": "image\/png",
"revpos": 4,
"stub": true,
"length": 14146,
"digest": "md5-5CXv6r+FvFGdt7ZycFh6Kw=="
},
"second.png": {
"content_type": "image\/png",
"revpos": 3,
"stub": true,
"length": 14146,
"digest": "md5-5CXv6r+FvFGdt7ZycFh6Kw=="
},
"first.png": {
"content_type": "image\/png",
"revpos": 2,
"stub": true,
"length": 14146,
"digest": "md5-5CXv6r+FvFGdt7ZycFh6Kw=="
}
},
"files": [{
"id": "first.png",
"isImage": true
}, {
"id": "second.png",
"isImage": true
}],
"forumThreadID": null
},
"changes": [{
"rev": "6-249fb9928de2539b2debe763fdf276f3"
}]
}],
"last_seq": 47231
}
Attachment deletion request
Request URL:http://localhost.touchdb./forums/ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb/third.png?rev=6-249fb9928de2539b2debe763fdf276f3
Request Method:DELETE
Status Code:200 OK
Response
{"id":"ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb","rev":"7-fda4b2cabb573f5c2a5e024ca8f334af","ok":true}
_changes feed request
Request URL:http://localhost.touchdb./forums/_changes?_dc=1351508903862&feed=longpoll&timeout=60000&include_docs=true&since=47231
Request Method:GET
Status Code:200 OK
Response
{
"results": [{
"seq": 47232,
"id": "ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb",
"doc": {
"sqlServerReplicationFlag": false,
"copy": null,
"personID": null,
"lastUpdated": null,
"personName": null,
"syncStatus": ["Draft"],
"type": "ThreadResponse",
"forumID": null,
"programmes": [],
"_id": "ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb",
"_rev": "7-fda4b2cabb573f5c2a5e024ca8f334af",
"created": null,
"videoFiles": [],
"files": [{
"id": "first.png",
"isImage": true
}, {
"id": "second.png",
"isImage": true
}],
"forumThreadID": null
},
"changes": [{
"rev": "7-fda4b2cabb573f5c2a5e024ca8f334af"
}]
}],
"last_seq": 47232
}
The response is missing the _attachments property even though the document still has 2 attachments. The equivalent _changes event on the couch cocoa _changes feed does contain the correct _attachments property. This sequence works using couchDB.
The following is the sequence of app request/response events. Three events are shown, these being the _changes feed for the event prior to the attachment deletion, the attachment deletion itself and the _changes feed event that resulted from the attachment deletion. Requests and responses are shown taken from the browser on the simulator using iWebInspector.
Incoming change prior to the attachment deletion
Request URL:http://localhost.touchdb./forums/_changes?_dc=1351508886109&feed=longpoll&timeout=60000&include_docs=true&since=47230
Request Method:GET
Status Code:200 OK
Response
{
"results": [{
"seq": 47231,
"id": "ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb",
"doc": {
"sqlServerReplicationFlag": false,
"copy": null,
"personID": null,
"lastUpdated": null,
"type": "ThreadResponse",
"personName": null,
"syncStatus": ["Draft"],
"_id": "ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb",
"programmes": [],
"forumID": null,
"_rev": "6-249fb9928de2539b2debe763fdf276f3",
"created": null,
"videoFiles": [],
"_attachments": {
"third.png": {
"content_type": "image\/png",
"revpos": 4,
"stub": true,
"length": 14146,
"digest": "md5-5CXv6r+FvFGdt7ZycFh6Kw=="
},
"second.png": {
"content_type": "image\/png",
"revpos": 3,
"stub": true,
"length": 14146,
"digest": "md5-5CXv6r+FvFGdt7ZycFh6Kw=="
},
"first.png": {
"content_type": "image\/png",
"revpos": 2,
"stub": true,
"length": 14146,
"digest": "md5-5CXv6r+FvFGdt7ZycFh6Kw=="
}
},
"files": [{
"id": "first.png",
"isImage": true
}, {
"id": "second.png",
"isImage": true
}],
"forumThreadID": null
},
"changes": [{
"rev": "6-249fb9928de2539b2debe763fdf276f3"
}]
}],
"last_seq": 47231
}
Attachment deletion request
Request URL:http://localhost.touchdb./forums/ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb/third.png?rev=6-249fb9928de2539b2debe763fdf276f3
Request Method:DELETE
Status Code:200 OK
Response
{"id":"ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb","rev":"7-fda4b2cabb573f5c2a5e024ca8f334af","ok":true}
_changes feed request
Request URL:http://localhost.touchdb./forums/_changes?_dc=1351508903862&feed=longpoll&timeout=60000&include_docs=true&since=47231
Request Method:GET
Status Code:200 OK
Response
{
"results": [{
"seq": 47232,
"id": "ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb",
"doc": {
"sqlServerReplicationFlag": false,
"copy": null,
"personID": null,
"lastUpdated": null,
"personName": null,
"syncStatus": ["Draft"],
"type": "ThreadResponse",
"forumID": null,
"programmes": [],
"_id": "ThreadResponse-837f4f3d-10a3-4415-97d1-17c0f259c0eb",
"_rev": "7-fda4b2cabb573f5c2a5e024ca8f334af",
"created": null,
"videoFiles": [],
"files": [{
"id": "first.png",
"isImage": true
}, {
"id": "second.png",
"isImage": true
}],
"forumThreadID": null
},
"changes": [{
"rev": "7-fda4b2cabb573f5c2a5e024ca8f334af"
}]
}],
"last_seq": 47232
}
The response is missing the _attachments property even though the document still has 2 attachments. The equivalent _changes event on the couch cocoa _changes feed does contain the correct _attachments property. This sequence works using couchDB.
Activity
- All
- Comments
- Work Log
- History
- Activity
- Gerrit Reviews