Skip to content

Commit b87ebd0

Browse files
committed
do not remove potentially inflight keys from availableKeys
Using all keys from estimated data + all keys from all operation sets instead.
1 parent 83d0745 commit b87ebd0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Parse/PFObject.m

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2320,12 +2320,21 @@ - (void)removeObjectForKey:(NSString *)key {
23202320
- (void)revert {
23212321
@synchronized (lock) {
23222322
if ([self isDirty]) {
2323+
NSMutableArray *removedKeys = [NSMutableArray array];
2324+
[removedKeys addObjectsFromArray: [self allKeys]];
2325+
for (PFOperationSet *operationSet in operationSetQueue) {
2326+
for (NSString *key in operationSet.keyEnumerator) {
2327+
[removedKeys addObject:key];
2328+
}
2329+
}
2330+
23232331
PFOperationSet *changes = [self unsavedChanges];
23242332
for (NSString *key in changes.keyEnumerator) {
23252333
[changes removeObjectForKey:key];
23262334
}
2335+
23272336
[self rebuildEstimatedData];
2328-
[_availableKeys removeAllObjects];
2337+
[_availableKeys minusSet:[NSSet setWithArray:removedKeys]];
23292338
[self checkpointAllMutableContainers];
23302339
}
23312340
}

0 commit comments

Comments
 (0)