fix regression in collab server

pull/282/merge
nightwing 2017-05-12 23:59:04 +04:00
rodzic b5fd1e998f
commit 6103223b2c
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -1941,9 +1941,6 @@ function syncDocument(docId, doc, client, forceSync, callback) {
function doSyncDocument() { function doSyncDocument() {
Fs.readFile(file, "utf8", function (err, contents) { Fs.readFile(file, "utf8", function (err, contents) {
if (typeof doc.contents != "string" && doc.contents)
doc.contents = doc.contents.toString(); // because it can be a buffer
if (err) if (err)
return callback(err); return callback(err);
@ -1954,6 +1951,9 @@ function syncDocument(docId, doc, client, forceSync, callback) {
var fsHash = hashString(normContents); var fsHash = hashString(normContents);
if (doc && typeof doc.contents != "string" && doc.contents)
doc.contents = doc.contents.toString(); // because it can be a buffer
// HACK: fsHash from database is unreliable (https://github.com/c9/newclient/issues/3980) // HACK: fsHash from database is unreliable (https://github.com/c9/newclient/issues/3980)
if (doc) if (doc)
doc.fsHash = hashString(doc.contents); doc.fsHash = hashString(doc.contents);