Add logging to help track down problems with Sync

Seems like we're running into errors sending the message to kick off the
sync, so positive logging as well as error logging is included.

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-08-17 12:20:40 -07:00
parent ef00c3828b
commit 4ef36cc95c
3 changed files with 32 additions and 2 deletions

View file

@ -19,8 +19,15 @@
this.ongroup = this.onGroupSyncComplete.bind(this);
receiver.addEventListener('groupsync', this.ongroup);
console.log('SyncRequest created. Sending contact sync message...');
sender.sendRequestContactSyncMessage().then(function() {
sender.sendRequestGroupSyncMessage();
console.log('SyncRequest now sending group sync messsage...');
return sender.sendRequestGroupSyncMessage();
}).catch(function(error) {
console.log(
'SyncRequest error:',
error && error.stack ? error.stack : error
);
});
this.timeout = setTimeout(this.onTimeout.bind(this), 60000);
}