sync attach [ok]

todo conflicts copy attach
This commit is contained in:
life
2015-01-31 22:04:20 +08:00
parent c309427fed
commit 00aac7c96a
9 changed files with 301 additions and 60 deletions

10
node_modules/sync.js generated vendored
View File

@@ -310,6 +310,8 @@ var Sync = {
// 同步失败
me._syncInfo.note.ok = false;
me._syncInfo.note.msg = "cann't get all chunks";
console.log(notes);
console.log('eeeeeeeeeeeeeeeeeerrror')
callback && callback(false);
}
});
@@ -375,6 +377,8 @@ var Sync = {
Note.fixConflicts(me._syncInfo.note, me._noteWeb, function() {
// 避免无限循环, 别send changes了
if(!me._needIncrSyncAgain) {
// alert("?")
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>")
// send changes
callback && callback();
}
@@ -555,6 +559,8 @@ var Sync = {
return cb();
});
} else {
console.log('local');
console.log(note);
// 更新
Api.updateNote(note, function(ret) {
if(!Common.isOk(ret)) {
@@ -571,7 +577,9 @@ var Sync = {
}
// 更新成功
// TODO 返回是真note
Note.updateNoteForceForSendChange({NoteId: note.NoteId, Usn: ret.Usn}, false);
ret.ServerNoteId = ret.NoteId;
ret.NoteId = note.NoteId;
Note.updateNoteForceForSendChange(ret, false);
me.checkNeedIncSyncAgain(ret.Usn);