kopia lustrzana https://github.com/c9/core
fix regression in collab server
rodzic
b5fd1e998f
commit
6103223b2c
|
@ -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,10 +1951,13 @@ 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);
|
||||||
|
|
||||||
if (!doc) {
|
if (!doc) {
|
||||||
logVerbose("[vfs-collab] SYNC: Creating document:", docId, fsHash);
|
logVerbose("[vfs-collab] SYNC: Creating document:", docId, fsHash);
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue