Skip to content

Commit 6268d4d

Browse files
committed
fix: promises should log/warn after trying send method
1 parent 8280f28 commit 6268d4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/server/push.api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,16 @@ Push.Configure = function(options) {
237237

238238
apnConnection.send(note, userToken).then( (response) => {
239239
response.sent.forEach( (token) => {
240-
notificationSent(user, token);
240+
console.log(`notification success for ${JSON.stringify(token)}`);
241241
});
242242
response.failed.forEach( (failure) => {
243243
if (failure.error) {
244244
// A transport-level error occurred (e.g. network problem)
245-
notificationError(user, failure.device, failure.error);
245+
console.warn(`potential network problem for device ${JSON.stringify(failure.device)}: ${JSON.stringify(failure.error)}.`);
246246
} else {
247247
// `failure.status` is the HTTP status code
248248
// `failure.response` is the JSON payload
249-
notificationFailed(user, failure.device, failure.status, failure.response);
249+
console.warn(`notification failure ${JSON.stringify(failure.status)} on device ${JSON.stringify(failure.device)}: ${JSON.stringify(failure.response)}.`);
250250
}
251251
});
252252
});

0 commit comments

Comments
 (0)