Skip to content

Commit def8305

Browse files
committed
Merge pull request #439 from ParsePlatform/nlutsenko.user.l
Remove potential deadlock from encoding PFUser.
2 parents 72ab52d + 0827f5a commit def8305

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

Parse/PFObject.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,12 +979,12 @@ - (NSDictionary *)RESTDictionaryWithObjectEncoder:(PFEncoder *)objectEncoder
979979
operationSetUUIDs:(NSArray **)operationSetUUIDs
980980
state:(PFObjectState *)state
981981
operationSetQueue:(NSArray *)queue
982-
deletingEventuallyCount:(NSUInteger)deleteingEventuallyCount {
982+
deletingEventuallyCount:(NSUInteger)deletingEventuallyCount {
983983
NSMutableDictionary *result = [[state dictionaryRepresentationWithObjectEncoder:objectEncoder] mutableCopy];
984984
result[PFObjectClassNameRESTKey] = state.parseClassName;
985985
result[PFObjectCompleteRESTKey] = @(state.complete);
986986

987-
result[PFObjectIsDeletingEventuallyRESTKey] = @(deleteingEventuallyCount);
987+
result[PFObjectIsDeletingEventuallyRESTKey] = @(deletingEventuallyCount);
988988

989989
// TODO (hallucinogen): based on some note from Android's toRest, we'll need to put this
990990
// stuff somewhere else

Parse/PFUser.m

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -652,23 +652,21 @@ - (NSDictionary *)RESTDictionaryWithObjectEncoder:(PFEncoder *)objectEncoder
652652
state:(PFObjectState *)state
653653
operationSetQueue:(NSArray *)queue
654654
deletingEventuallyCount:(NSUInteger)deletingEventuallyCount {
655-
@synchronized (self.lock) {
656-
NSMutableArray *cleanQueue = [queue mutableCopy];
657-
[queue enumerateObjectsUsingBlock:^(PFOperationSet *operationSet, NSUInteger idx, BOOL *stop) {
658-
// Remove operations for `password` field, to not let it persist to LDS.
659-
if (operationSet[PFUserPasswordRESTKey]) {
660-
operationSet = [operationSet copy];
661-
[operationSet removeObjectForKey:PFUserPasswordRESTKey];
662-
663-
cleanQueue[idx] = operationSet;
664-
}
665-
}];
666-
return [super RESTDictionaryWithObjectEncoder:objectEncoder
667-
operationSetUUIDs:operationSetUUIDs
668-
state:state
669-
operationSetQueue:cleanQueue
670-
deletingEventuallyCount:deletingEventuallyCount];
671-
}
655+
NSMutableArray *cleanQueue = [queue mutableCopy];
656+
[queue enumerateObjectsUsingBlock:^(PFOperationSet *operationSet, NSUInteger idx, BOOL *stop) {
657+
// Remove operations for `password` field, to not let it persist to LDS.
658+
if (operationSet[PFUserPasswordRESTKey]) {
659+
operationSet = [operationSet copy];
660+
[operationSet removeObjectForKey:PFUserPasswordRESTKey];
661+
662+
cleanQueue[idx] = operationSet;
663+
}
664+
}];
665+
return [super RESTDictionaryWithObjectEncoder:objectEncoder
666+
operationSetUUIDs:operationSetUUIDs
667+
state:state
668+
operationSetQueue:cleanQueue
669+
deletingEventuallyCount:deletingEventuallyCount];
672670
}
673671

674672
///--------------------------------------

0 commit comments

Comments
 (0)