From fc38c9de44db9db99c30a2247b19812838c50f98 Mon Sep 17 00:00:00 2001 From: Gabriel de Oliveira Barbosa Date: Fri, 24 Feb 2012 19:12:55 -0200 Subject: [PATCH 1/4] Stop try to parse native object on create app --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index a2bc259..4d1827f 100644 --- a/main.js +++ b/main.js @@ -149,7 +149,7 @@ function createApp (doc, url, cb) { request({uri:url, method:'PUT', body:body, headers:h}, function (err, resp, body) { if (err) throw err; if (resp.statusCode !== 201) throw new Error("Could not push document\n"+body) - app.doc._rev = JSON.parse(body).rev + app.doc._rev = body.rev console.log('Finished push. '+app.doc._rev) playSound(); request({uri:url, headers:h}, function (err, resp, body) { From 6c5a50c75e7693585cac361346a80dfc3ebb8150 Mon Sep 17 00:00:00 2001 From: Gabriel de Oliveira Barbosa Date: Fri, 24 Feb 2012 19:24:25 -0200 Subject: [PATCH 2/4] same error --- main.js | 1 - 1 file changed, 1 deletion(-) diff --git a/main.js b/main.js index 4d1827f..f3153fa 100644 --- a/main.js +++ b/main.js @@ -153,7 +153,6 @@ function createApp (doc, url, cb) { console.log('Finished push. '+app.doc._rev) playSound(); request({uri:url, headers:h}, function (err, resp, body) { - body = JSON.parse(body); app.doc._attachments = body._attachments; if (callback) callback() }) From a9c4e204656e95a477986febaafcad3099b8291c Mon Sep 17 00:00:00 2001 From: Gabriel de Oliveira Barbosa Date: Fri, 24 Feb 2012 21:03:14 -0200 Subject: [PATCH 3/4] another parsing error --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index f3153fa..38fd567 100644 --- a/main.js +++ b/main.js @@ -302,7 +302,7 @@ function createApp (doc, url, cb) { if (err) throw err; if (resp.statusCode == 404) app.current = {}; else if (resp.statusCode !== 200) throw new Error("Failed to get doc\n"+body) - else app.current = JSON.parse(body) + else app.current = body cb(app) }) } From 921a195fc7d41d36dadcf921b75d561052fb4155 Mon Sep 17 00:00:00 2001 From: Gabriel de Oliveira Barbosa Date: Tue, 3 Apr 2012 14:25:10 -0300 Subject: [PATCH 4/4] test mikel/request compatible version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5e57cf..35b9c5d 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ , "main" : "./main" , "dependencies": { "watch": "*" - , "request": "*" + , "request": "2.9.150" } , "bin": { "couchapp" : "./bin.js" } }