multi-cluster support; use new 'newer' flag instead of 'modified' for collection searches
authorDan Mills <thunder@mozilla.com>
Tue, 10 Feb 2009 00:57:16 -0800
changeset 45232 b2b269fc4ecf6e4ae1eb27bd9bced465971c555b
parent 45231 564c1c1ca190dc32b71409f51012dec4c6acaadd
child 45233 50cb25ce097885dfe8e1e47f9ad7b3df7dd9d5a1
push idunknown
push userunknown
push dateunknown
multi-cluster support; use new 'newer' flag instead of 'modified' for collection searches
services/sync/modules/engines.js
--- a/services/sync/modules/engines.js
+++ b/services/sync/modules/engines.js
@@ -176,18 +176,23 @@ SyncEngine.prototype = {
 
   get _memory() {
     let mem = Cc["@mozilla.org/xpcom/memory-service;1"].getService(Ci.nsIMemory);
     this.__defineGetter__("_memory", function() mem);
     return mem;
   },
 
   get baseURL() {
-    let url = Utils.prefs.getCharPref("serverURL");
-    if (url && url[url.length-1] != '/')
+    let url = Svc.Prefs.get("clusterURL");
+    if (!url)
+      return null;
+    // XXX tmp hack for sm-weave-proxy01
+    if (url == "https://sm-weave-proxy01.services.mozilla.com/")
+      return "https://sm-weave-proxy01.services.mozilla.com/weave/0.3/";
+    if (url[url.length-1] != '/')
       url += '/';
     url += "0.3/user/";
     return url;
   },
 
   get engineURL() {
     return this.baseURL + ID.get('WeaveID').username + '/' + this.name + '/';
   },
@@ -282,17 +287,17 @@ SyncEngine.prototype = {
     // enable cache, and keep only the first few items.  Otherwise (when
     // we have more outgoing items than can fit in the cache), we will
     // keep rotating items in and out, perpetually getting cache misses
     this._store.cache.enabled = true;
     this._store.cache.fifo = false; // filo
     this._store.cache.clear();
 
     let newitems = new Collection(this.engineURL, this._recordObj);
-    newitems.modified = this.lastSync;
+    newitems.newer = this.lastSync;
     newitems.full = true;
     newitems.sort = "depthindex";
     yield newitems.get(self.cb);
 
     let item;
     let count = {applied: 0, reconciled: 0};
     this._lastSyncTmp = 0;
     while ((item = yield newitems.iter.next(self.cb))) {