Skip to content

Commit 165dc81

Browse files
authored
Merge branch 'master' into modernization
2 parents 3957711 + 98ba23c commit 165dc81

File tree

26 files changed

+62
-121
lines changed

26 files changed

+62
-121
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
- TEST_TYPE=iOS
1313
- TEST_TYPE=macOS
1414
- TEST_TYPE=Deployment
15-
- TEST_TYPE=Starters
15+
- TEST_TYPE=Carthage
1616
- TEST_TYPE=CocoaPods
1717
git:
1818
submodules: false

Parse.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Parse'
3-
s.version = '1.15.2'
3+
s.version = '1.15.3'
44
s.license = { :type => 'BSD', :file => 'LICENSE' }
55
s.homepage = 'http://parseplatform.org/'
66
s.summary = 'A library that gives you access to the powerful Parse cloud platform from your iOS/OS X/watchOS/tvOS app.'

Parse.xcodeproj/project.pbxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8839,6 +8839,7 @@
88398839
isa = XCBuildConfiguration;
88408840
baseConfigurationReference = 81DCD14A1D2DA080002501A2 /* Release.xcconfig */;
88418841
buildSettings = {
8842+
CLANG_ENABLE_CODE_COVERAGE = NO;
88428843
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
88438844
CLANG_WARN_COMMA = YES;
88448845
CLANG_WARN_INFINITE_RECURSION = YES;

Parse/Internal/LocalDataStore/OfflineQueryLogic/PFOfflineQueryLogic.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ - (id)valueForContainer:(id)container
145145
} else if ([key isEqualToString:@"updatedAt"] || [key isEqualToString:@"_updated_at"]) {
146146
return object.updatedAt;
147147
} else {
148-
return object[key];
148+
return key ? object[key] : nil;
149149
}
150150
} else if ([container isKindOfClass:[NSDictionary class]]) {
151151
return ((NSDictionary *)container)[key];

Parse/Internal/PFEventuallyQueue.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
@class BFTask<__covariant BFGenericType>;
1818
@class PFEventuallyPin;
19-
@class PFEventuallyQueueTestHelper;
2019
@class PFObject;
2120
@protocol PFCommandRunnerProvider;
2221

@@ -39,9 +38,6 @@ extern NSTimeInterval const PFEventuallyQueueDefaultTimeoutRetryInterval;
3938
@property (atomic, assign, readonly) BOOL monitorsReachability PF_WATCH_UNAVAILABLE;
4039
@property (nonatomic, assign, readonly, getter=isConnected) BOOL connected;
4140

42-
// Gets notifications of various events happening in the command cache, so that tests can be synchronized.
43-
@property (nonatomic, strong, readonly) PFEventuallyQueueTestHelper *testHelper;
44-
4541
///--------------------------------------
4642
#pragma mark - Init
4743
///--------------------------------------
@@ -71,26 +67,3 @@ extern NSTimeInterval const PFEventuallyQueueDefaultTimeoutRetryInterval;
7167
- (void)removeAllCommands NS_REQUIRES_SUPER;
7268

7369
@end
74-
75-
typedef enum {
76-
PFEventuallyQueueEventCommandEnqueued, // A command was placed into the queue.
77-
PFEventuallyQueueEventCommandNotEnqueued, // A command could not be placed into the queue.
78-
79-
PFEventuallyQueueEventCommandSucceded, // A command has successfully running on the server.
80-
PFEventuallyQueueEventCommandFailed, // A command has failed on the server.
81-
82-
PFEventuallyQueueEventObjectUpdated, // An object's data was updated after a command completed.
83-
PFEventuallyQueueEventObjectRemoved, // An object was removed because it was deleted before creation.
84-
85-
PFEventuallyQueueEventCount // The total number of items in this enum.
86-
} PFEventuallyQueueTestHelperEvent;
87-
88-
@interface PFEventuallyQueueTestHelper : NSObject {
89-
dispatch_semaphore_t events[PFEventuallyQueueEventCount];
90-
}
91-
92-
- (void)clear;
93-
- (void)notify:(PFEventuallyQueueTestHelperEvent)event;
94-
- (BOOL)waitFor:(PFEventuallyQueueTestHelperEvent)event;
95-
96-
@end

Parse/Internal/PFEventuallyQueue.m

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ - (instancetype)initWithDataSource:(id<PFCommandRunnerProvider>)dataSource
7373
_commandEnqueueTaskQueue = [[PFTaskQueue alloc] init];
7474

7575
_taskCompletionSources = [NSMutableDictionary dictionary];
76-
_testHelper = [[PFEventuallyQueueTestHelper alloc] init];
7776

7877
[self _startMonitoringNetworkReachability];
7978

@@ -103,14 +102,11 @@ - (BFTask *)enqueueCommandInBackground:(id<PFNetworkCommand>)command withObject:
103102
object:object
104103
identifier:identifier] continueWithBlock:^id(BFTask *task) {
105104
if (task.faulted || task.cancelled) {
106-
[self.testHelper notify:PFEventuallyQueueEventCommandNotEnqueued];
107105
if (task.error) {
108106
taskCompletionSource.error = task.error;
109107
} else if (task.cancelled) {
110108
[taskCompletionSource cancel];
111109
}
112-
} else {
113-
[self.testHelper notify:PFEventuallyQueueEventCommandEnqueued];
114110
}
115111

116112
return task;
@@ -337,12 +333,6 @@ - (BFTask *)_didFinishRunningCommand:(id<PFNetworkCommand>)command
337333
[_taskCompletionSources removeObjectForKey:identifier];
338334
});
339335

340-
if (resultTask.faulted || resultTask.cancelled) {
341-
[self.testHelper notify:PFEventuallyQueueEventCommandFailed];
342-
} else {
343-
[self.testHelper notify:PFEventuallyQueueEventCommandSucceded];
344-
}
345-
346336
return resultTask;
347337
}
348338

@@ -437,11 +427,6 @@ - (int)_commandsInMemory {
437427
return (int)_taskCompletionSources.count;
438428
}
439429

440-
/** Called by PFObject whenever an object has been updated after a saveEventually. */
441-
- (void)_notifyTestHelperObjectUpdated {
442-
[self.testHelper notify:PFEventuallyQueueEventObjectUpdated];
443-
}
444-
445430
- (void)_setMaxAttemptsCount:(NSUInteger)attemptsCount {
446431
_maxAttemptsCount = attemptsCount;
447432
}
@@ -465,33 +450,3 @@ - (void)reachability:(PFReachability *)reachability didChangeReachabilityState:(
465450
#endif
466451

467452
@end
468-
469-
// PFEventuallyQueueTestHelper gets notifications of various events happening in the command cache,
470-
// so that tests can be synchronized. See CommandTests.m for examples of how to use this.
471-
472-
@implementation PFEventuallyQueueTestHelper
473-
474-
- (instancetype)init {
475-
self = [super init];
476-
if (self) {
477-
[self clear];
478-
}
479-
return self;
480-
}
481-
482-
- (void)clear {
483-
for (int i = 0; i < PFEventuallyQueueEventCount; ++i) {
484-
events[i] = dispatch_semaphore_create(0);
485-
}
486-
}
487-
488-
- (void)notify:(PFEventuallyQueueTestHelperEvent)event {
489-
dispatch_semaphore_signal(events[event]);
490-
}
491-
492-
- (BOOL)waitFor:(PFEventuallyQueueTestHelperEvent)event {
493-
// Wait 1 second for a permit from the semaphore.
494-
return (dispatch_semaphore_wait(events[event], dispatch_time(DISPATCH_TIME_NOW, 10LL * NSEC_PER_SEC)) == 0);
495-
}
496-
497-
@end

Parse/Internal/PFEventuallyQueue_Private.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,7 @@ extern NSTimeInterval const PFEventuallyQueueDefaultTimeoutRetryInterval;
6464
- (void)_startMonitoringNetworkReachability;
6565
- (void)_stopMonitoringNetworkReachability;
6666

67-
///--------------------------------------
68-
#pragma mark - Test Helper
69-
///--------------------------------------
70-
71-
- (void)_setMaxAttemptsCount:(NSUInteger)attemptsCount;
72-
73-
- (void)_setRetryInterval:(NSTimeInterval)retryInterval;
74-
7567
- (void)_simulateReboot NS_REQUIRES_SUPER;
76-
77-
- (int)_commandsInMemory;
78-
79-
- (void)_notifyTestHelperObjectUpdated;
80-
8168
@end
8269

8370
@protocol PFEventuallyQueueSubclass <NSObject>

Parse/Internal/PFLocationManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ - (void)addBlockForCurrentLocation:(PFLocationManagerLocationUpdateBlock)handler
126126
if ([NSThread currentThread].isMainThread) {
127127
block();
128128
} else {
129-
dispatch_sync(dispatch_get_main_queue(), block);
129+
dispatch_async(dispatch_get_main_queue(), block);
130130
}
131131
}
132132
[self.locationManager startUpdatingLocation];

Parse/Internal/PFReachability.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ - (void)removeListener:(id<PFReachabilityListener>)listener {
135135
@strongify(listener);
136136
[_listenersArray filterUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
137137
id weakObject = [evaluatedObject weakObject];
138-
return (weakObject == nil || weakObject == listener);
138+
return !(weakObject == nil || weakObject == listener);
139139
}]];
140140
});
141141
}
@@ -156,7 +156,7 @@ - (void)_notifyAllListeners {
156156
}
157157

158158
dispatch_barrier_async(_synchronizationQueue, ^{
159-
[_listenersArray filterUsingPredicate:[NSPredicate predicateWithFormat:@"SELf.weakObject != nil"]];
159+
[_listenersArray filterUsingPredicate:[NSPredicate predicateWithFormat:@"SELF.weakObject != nil"]];
160160
});
161161
});
162162
}

Parse/Internal/PropertyInfo/PFPropertyInfo.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ - (instancetype)initWithClass:(Class)kls name:(NSString *)propertyName
9494
propertySetter = [NSString stringWithFormat:@"set%@:", stringByCapitalizingFirstCharacter(_name)];
9595
}
9696

97-
_setterSelector = NSSelectorFromString(propertySetter);
97+
if (propertySetter != nil) {
98+
_setterSelector = NSSelectorFromString(propertySetter);
99+
}
98100

99101
if (_associationType == PFPropertyInfoAssociationTypeDefault) {
100102
BOOL isCopy = safeStringWithPropertyAttributeValue(objcProperty, "C") != nil;

0 commit comments

Comments
 (0)