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); DDLogDebug(@"%@ Successfully ran syncPushTokensJob.", self.tag);
}) })
.catch(^(NSError *_Nonnull error) { .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. // Clean up any messages that expired since last launch.

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

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

Loading…
Cancel
Save