Skip to content

Commit 6b066c9

Browse files
ananfangflovilmart
authored andcommitted
Hot fix for #1237 and #1202 (#1256)
* 1. Fix typo PFPreconditionFailOnError and PFPreconditionFailAndSetError. 2. If there is a new object in OfflineStore, should not send the exception when the saved object update its OfflineStore cache * Change the condition about newly saved object * fix typo * Revert to PFPreconditionBailOnError and PFPreconditionBailAndSetError
1 parent c9d6550 commit 6b066c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Parse/Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,9 @@ - (void)updateObjectIdForObject:(PFObject *)object
10281028
@synchronized(self.lock) {
10291029
// See if there's already an entry for new objectId.
10301030
PFObject *existing = [self.classNameAndObjectIdToObjectMap objectForKey:key];
1031-
PFConsistencyAssert(existing == nil || existing == object,
1031+
// If this object is just saved, update local store without exception.
1032+
BOOL isNewlySaved = (oldObjectId == nil) && (object.createdAt != nil);
1033+
PFConsistencyAssert(isNewlySaved || existing == nil || existing == object,
10321034
@"Attempted to change an objectId to one that's already known to the OfflineStore. className: %@ old: %@, new: %@",
10331035
className, oldObjectId, newObjectId);
10341036

0 commit comments

Comments
 (0)