sbisbee/sag — Issue #45: timeout using update handler
Author: hardtke
Created: 2012-01-26 20:51:55+00:00
State: open

When PUT ting to an update handler on a Cloudant hosted database, we get a timeout unless the response from the update handler is an empty string:

This will work:

{
"_id": "_design/tag",
"_rev": "9-262f4cdf044ebd73f33f3565f3332e2b",
"updates": {
"duplicate": "function(doc,req) {if (!doc) {return [null,'document does not exist'];} doc.duplicate=true;return [doc,''];}",
"expired": "function(doc,req) {if (!doc) {return [null,'document does not exist'];} doc.expired=true;return [doc,''];}"
}
}

This will not:{
"_id": "_design/tag",
"_rev": "9-262f4cdf044ebd73f33f3565f3332e2b",
"updates": {
"duplicate": "function(doc,req) {if (!doc) {return [null,'document does not exist'];} doc.duplicate=true;return [doc,'some text'];}",
"expired": "function(doc,req) {if (!doc) {return [null,'document does not exist'];} doc.expired=true;return [doc,'some text'];}"
}
}
note that in the second case the database gets updated, but the Sag put call times out.