New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apn

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apn - npm Package Compare versions

Comparing version 1.3.7 to 1.3.8

5

ChangeLog.md
## Changelog
1.3.8:
* Notifications now have a configurable number of retries. See `Notification.retryLimit` in docs.
* Fixed: Error wasn't raised on notifications if the module fails to initialise, they just perpetually lived on the queue.
1.3.7:

@@ -4,0 +9,0 @@

16

lib/connection.js

@@ -214,2 +214,10 @@ var Errors = require('./errors');

debug("Module initialisation error:", error);
// This is a pretty fatal scenario, we don't have key/certificate to connect to APNS, there's not much we can do, so raise errors and clear the queue.
while(this.notificationBuffer.length > 0) {
var notification = this.notificationBuffer.shift();
this.raiseError(error, notification.notification, notification.recipient);
this.emit('transmissionError', Errors['moduleInitialisationFailed'], notification.notification, notification.recipient);
}
this.raiseError(error);
this.emit('error', error);

@@ -404,2 +412,8 @@ this.deferredConnection.reject(error);

Connection.prototype.bufferNotification = function (notification) {
if (notification.retryLimit === 0) {
this.raiseError(Errors['retryCountExceeded'], notification);
this.emit('transmissionError', Errors['retryCountExceeded'], notification.notification, notification.recipient);
return;
}
notification.retryLimit -= 1;
this.notificationBuffer.push(notification);

@@ -436,3 +450,3 @@ };

}
this.bufferNotification( { "notification": notification, "recipient": recipient } );
this.bufferNotification( { "notification": notification, "recipient": recipient, "retryLimit": notification.retryLimit } );
};

@@ -439,0 +453,0 @@

4

lib/errors.js

@@ -17,5 +17,7 @@ /**

'apnsShutdown': 10,
'none': 255
'none': 255,
'retryLimitExceeded': 512,
'moduleInitialisationFailed': 513
};
module.exports = Errors;

@@ -12,2 +12,4 @@ /**

this.retryLimit = -1;
/** @deprecated since v1.3.0 used connection#pushNotification instead which accepts device token separately **/

@@ -14,0 +16,0 @@ this.device = undefined;

{
"name": "apn",
"description": "An interface to the Apple Push Notification service for Node.js",
"version": "1.3.7",
"version": "1.3.8",
"author": "Andrew Naylor <argon@mkbot.net>",

@@ -6,0 +6,0 @@ "contributors": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc