anchor.diff:    bool collectRes = true;
   
     diff.forEach((Map change) {
  +    var _records = collection.findBy("_id", change["_id"]);
  +    DataMap record = _records.isNotEmpty? _records.first : null;
  +    String action = change["action"];
  +
       logger.finer('handling change $change');
   //     it can happen, that we get too old changes
       if (!change.containsKey('version')){
  
positive.code:     } else if(change['version'] <= version) {
        return;
      }
        if (change["action"] == "add") {
          if (collectRes) res = max(res, change['version']);
          if (collection.findBy('_id', change['_id']).isEmpty){
            logger.finer('aplying changes (add)');
            collection.add(change["data"]);
          } else {
  
negative.code:         applyChange(change["data"], record);
        }
      }
        else if (action == "remove" ) {
        logger.finer('aplying changes (remove');
        if (collectRes) res = max(res, change['version']);
        collection.remove(record);
      }
      logger.finest('applying finished: $subscription ${subscription.collection} ${subscription._version}');
    });
  