fix bookmark deletion sync
authorDan Mills <thunder@mozilla.com>
Tue, 25 Nov 2008 01:49:02 +0900
changeset 45050 45aba29f1e2f705e297c2759ca035e5377c4e870
parent 45049 a45e3441ed04a71e480d6d1793995792d7964948
child 45051 c3668d0c4c1b36b3c43282fccc3f6938f2f8a298
push idunknown
push userunknown
push dateunknown
fix bookmark deletion sync
services/sync/modules/engines/bookmarks.js
--- a/services/sync/modules/engines/bookmarks.js
+++ b/services/sync/modules/engines/bookmarks.js
@@ -913,20 +913,20 @@ BookmarksStore.prototype = {
 
     if (!this._lookup)
       this.wrap();
 
     yield record.decrypt(self.cb, ID.get('WeaveCryptoID').password);
 
     this._log.trace("RECORD: " + record.id + " -> " + uneval(record.cleartext));
 
-    if (!this._lookup[record.id])
+    if (record.cleartext == "")
+      this._removeCommand({GUID: record.id});
+    else if (!this._lookup[record.id])
       this._createCommand({GUID: record.id, data: record.cleartext});
-    else if (record.cleartext == "")
-      this._removeCommand({GUID: record.id});
     else {
       let data = Utils.deepCopy(record.cleartext);
       delete data.GUID;
       this._editCommand({GUID: record.id, data: data});
     }
   },
   applyIncoming: function BStore_applyIncoming(onComplete, record) {
     this._applyIncoming.async(this, onComplete, record);