From e2541f62cfbf38e8ddc3422a171bbc2edf199365 Mon Sep 17 00:00:00 2001 From: Tim Robinson Date: Wed, 23 Mar 2016 15:29:00 +0000 Subject: [PATCH] Adding client side logs around saving to determine if we're somehow failing to save to disk correctly --- package.json | 4 ++-- plugins/c9.fs/fs.streams.js | 4 ++++ plugins/c9.fs/fs.xhr.js | 5 +++++ plugins/c9.vfs.client/vfs_client.js | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8c0b1f7c..aaa9ab7e 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "c9.ide.language.javascript.infer": "#325ac6880e", "c9.ide.language.jsonalyzer": "#4b329741b1", "c9.ide.language.codeintel": "#046d39603b", - "c9.ide.collab": "#11a0d3c5ce", + "c9.ide.collab": "#7e6b7225f3", "c9.ide.local": "#10eb45842a", "c9.ide.find": "#e33fbaed2f", "c9.ide.find.infiles": "#c0a13737ef", @@ -108,7 +108,7 @@ "c9.ide.run": "#485f06bd22", "c9.ide.run.build": "#0598fff697", "c9.ide.run.debug.xdebug": "#9956689819", - "c9.ide.save": "#4cda35bfdb", + "c9.ide.save": "#8219605f37", "c9.ide.scm": "#dc87315012", "c9.ide.terminal.monitor": "#1a4092ede2", "c9.ide.test": "#a282ec1619", diff --git a/plugins/c9.fs/fs.streams.js b/plugins/c9.fs/fs.streams.js index 19a5fbfe..f0d72435 100644 --- a/plugins/c9.fs/fs.streams.js +++ b/plugins/c9.fs/fs.streams.js @@ -33,6 +33,8 @@ return function(vfs, base, baseProc, cli) { if (encoding) options.encoding = encoding; + console.log("[vfs.stream] Reading file " + path); + vfs.readfile(resolvePath(path), options, function(err, meta) { if (err) return callback(err); @@ -70,6 +72,8 @@ return function(vfs, base, baseProc, cli) { var stream = options.stream = new Stream(); stream.readable = true; + console.log("[vfs.stream] Writing file " + path); + vfs.mkfile(resolvePath(path), options, function(err, meta) { if (err) return callback(err); diff --git a/plugins/c9.fs/fs.xhr.js b/plugins/c9.fs/fs.xhr.js index 69020713..a604b78d 100644 --- a/plugins/c9.fs/fs.xhr.js +++ b/plugins/c9.fs/fs.xhr.js @@ -4,6 +4,7 @@ define(function (require, exports, module) { return function(_request) { function request(method, path, body, callback, progress, sync, headers) { + // This goes to rest() function in vfs_client.js return _request(path, { method: method, body: body, @@ -31,6 +32,8 @@ return function(_request) { return callback(err); } + console.log("[vfs.xhr] Reading file " + path); + var headers = metadata ? { "x-request-metadata" : "true" } : null; return request("GET", path, "", function(err, data, res) { if (err) @@ -77,6 +80,8 @@ return function(_request) { // It would then be interpreted as a directory if (path.substr(-1) == "/") path = path.substr(0, path.length - 1); + + console.log("[vfs.xhr] Writing file " + path); return request("PUT", path, data, callback, progress, sync); } diff --git a/plugins/c9.vfs.client/vfs_client.js b/plugins/c9.vfs.client/vfs_client.js index 9e11a4d0..c61ebc73 100644 --- a/plugins/c9.vfs.client/vfs_client.js +++ b/plugins/c9.vfs.client/vfs_client.js @@ -146,6 +146,7 @@ define(function(require, exports, module) { function rest(path, options, callback) { if (!vfs || !connection || connection.readyState != "open") { + console.error("[vfs-client] Cannot perform rest action for ", path, " vfs is disconnected"); var stub = { abort: function(){ buffer[this.id]= null; } }; stub.id = buffer.push([path, options, callback, stub]) - 1; return stub;