Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apns2

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apns2 - npm Package Compare versions

Comparing version 9.2.0 to 9.3.0

4

CHANGELOG.md

@@ -7,2 +7,6 @@ # Change Log

## [9.3.0](https://github.com/AndrewBarba/apns2/releases/tag/9.3.0)
1. Update token refresh logic to avoid `TooManyProviderTokenUpdates`
## [9.2.0](https://github.com/AndrewBarba/apns2/releases/tag/9.2.0)

@@ -9,0 +13,0 @@

15

lib/apns.js

@@ -72,6 +72,3 @@ const { EventEmitter } = require('events')

this._client = new Http2Client(host, { port, requestTimeout, pingInterval })
this._resetTokenInterval = setInterval(
() => this._resetSigningToken(),
RESET_TOKEN_INTERVAL_MS
).unref()
this._token = null
this.on(Errors.expiredProviderToken, () => this._resetSigningToken())

@@ -179,4 +176,4 @@ }

_getSigningToken() {
if (this._token) {
return this._token
if (this._token && Date.now() - this._token.timestamp < RESET_TOKEN_INTERVAL_MS) {
return this._token.value
}

@@ -208,3 +205,6 @@

this._token = token
this._token = {
value: token,
timestamp: Date.now()
}

@@ -220,3 +220,2 @@ return token

this._token = null
return this._getSigningToken()
}

@@ -223,0 +222,0 @@ }

{
"name": "apns2",
"version": "9.2.0",
"version": "9.3.0",
"description": "Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens.",

@@ -5,0 +5,0 @@ "author": "Andrew Barba <barba@hey.com>",

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