B2G/gecko/services/sync/modules/engines.js
// Save the current snapshot so as to calculate changes at next sync
Save the current snapshot so as to calculate changes at next sync
Save the current snapshot so as to calculate changes at next sync
function SyncEngine__syncFinish() {
    this._log.trace("Finishing up sync");
    this._tracker.resetScore();
    let doDelete = Utils.bind2(this, function(key, val) {
      let coll = new Collection(this.engineURL, this._recordObj);
      coll[key] = val;
      coll.delete();
    });
    for (let [key, val] in Iterator(this._delete)) {
      delete this._delete[key];
      if (key != "ids" || val.length <= 100)
        doDelete(key, val);
      else {
        while (val.length > 0) {
          doDelete(key, val.slice(0, 100));
          val = val.slice(100);
        }
      }
    }
  }
function SyncEngine__syncFinish ( ) { this . _log . trace ( "Finishing up sync" ) ; this . _tracker . resetScore ( ) ; let doDelete = Utils . bind2 ( this , function ( key , val ) { let coll = new Collection ( this . engineURL , this . _recordObj ) ; coll [ key ] = val ; coll . delete ( ) ; } ) ; for ( let [ key , val ] in Iterator ( this . _delete ) ) { delete this . _delete [ key ] ; if ( key != "ids" || val . length <= 100 ) doDelete ( key , val ) ; else { while ( val . length > 0 ) { doDelete ( key , val . slice ( 0 , 100 ) ) ; val = val . slice ( 100 ) ; } } } }
Save the current snapshot so as to calculate changes at next sync
Save the current snapshot so as to calculate changes at next sync
// Remove the key for future uses // Send a simple delete for the property // For many ids, split into chunks of at most 100