anchor.diff:        var allInserts = <db.Model>[]..addAll(users)..addAll(expandoPersons);
         var allKeys = allInserts.map((db.Model model) => model.key).toList();
         return store.commit(inserts: allInserts).then((_) {
  -        return waitUntilEntitiesReady(store, allKeys, partition).then((_) {
  +        return Future.wait([
  +          waitUntilEntitiesReady<User>(
  +              store, users.map((u) => u.key).toList(), partition),
  +          waitUntilEntitiesReady<ExpandoPerson>(
  +              store, expandoPersons.map((u) => u.key).toList(), partition),
  +        ]).then((_) {
             var tests = [
               // Queries for [Person] return no results, we only have [User]
               // objects.
  
positive.code:             () => store.commit(deletes: allKeys),
  
              // Wait until the entity deletes are reflected in the indices.
              () => waitUntilEntitiesGone(store, allKeys, partition),
  
              // Make sure queries don't return results
              () => store.lookup(allKeys).then((List<db.Model> models) {
  
negative.code:       "Tried running a query with exponential backoff, giving up now.");
  }
  
  Future waitUntilEntitiesReady<T extends db.Model>(
      db.DatastoreDB mdb, List<db.Key> keys, db.Partition partition) {
    return waitUntilEntitiesHelper<T>(mdb, keys, true, partition);
  }
  
  Future waitUntilEntitiesGone<T extends db.Model>(
      db.DatastoreDB mdb, List<db.Key> keys, db.Partition partition) {
    return waitUntilEntitiesHelper<T>(mdb, keys, false, partition);
  }
  
  Future<void> waitUntilEntitiesHelper<T extends db.Model>(
    db.DatastoreDB mdb,
    List<db.Key> keys,
    bool positive,
    db.Partition partition,
  ) async {
    bool done = false;
    while (!done) {
      final models = await mdb.query<T>(partition: partition).run().toList();
  
      done = true;
      for (var key in keys) {
        bool found = false;
        for (var model in models) {
          if (key == model.key) found = true;
        }
        if (positive) {
          if (!found) {
            done = false;
          }
        } else {
          if (found) {
            done = false;
          }
        }
      }
      return null;
    }
  }
  
  Future main() async {
  