Improve logging around SyncPushTokensJob.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent ad3a1a671a
commit aba29ac5ce

@ -156,7 +156,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
DDLogDebug(@"%@ Successfully ran syncPushTokensJob.", self.tag);
})
.catch(^(NSError *_Nonnull error) {
DDLogDebug(@"%@ Failed to run syncPushTokensJob with error: %@", self.tag, error);
DDLogError(@"%@ Failed to run syncPushTokensJob with error: %@", self.tag, error);
});
// Clean up any messages that expired since last launch.

@ -137,9 +137,11 @@ typedef NS_ENUM(NSInteger, AdvancedSettingsTableViewControllerSection) {
syncJob.uploadOnlyIfStale = NO;
[syncJob run]
.then(^{
DDLogDebug(@"%@ Successfully ran syncPushTokensJob.", self.tag);
SignalAlertView(NSLocalizedString(@"PUSH_REGISTER_SUCCESS", @"Alert title"), nil);
})
.catch(^(NSError *error) {
DDLogError(@"%@ Failed to run syncPushTokensJob with error: %@", self.tag, error);
SignalAlertView(NSLocalizedString(@"REGISTRATION_BODY", @"Alert title"), error.localizedDescription);
});

@ -18,6 +18,7 @@
#import "TSStorageManager.h"
#import "UIUtil.h"
#import "VersionMigrations.h"
#import <PromiseKit/AnyPromise.h>
#import <SignalServiceKit/OWSBlockingManager.h>
#import <SignalServiceKit/OWSMessageSender.h>
#import <SignalServiceKit/TSMessagesManager.h>
@ -336,11 +337,15 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS
- (void)ensureNotificationsUpToDate
{
OWSSyncPushTokensJob *syncPushTokensJob =
[[OWSSyncPushTokensJob alloc] initWithPushManager:[PushManager sharedManager]
accountManager:self.accountManager
preferences:[Environment preferences]];
[syncPushTokensJob run];
[OWSSyncPushTokensJob runWithPushManager:[PushManager sharedManager]
accountManager:self.accountManager
preferences:[Environment preferences]]
.then(^{
DDLogDebug(@"%@ Successfully ran syncPushTokensJob.", self.tag);
})
.catch(^(NSError *_Nonnull error) {
DDLogError(@"%@ Failed to run syncPushTokensJob with error: %@", self.tag, error);
});
}
- (void)tableViewSetUp {

Loading…
Cancel
Save