🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@superhuman/push-receiver

Package Overview
Dependencies
Maintainers
9
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@superhuman/push-receiver - npm Package Compare versions

Comparing version
2.1.2
to
2.1.3
+1
-1
package.json
{
"name": "@superhuman/push-receiver",
"version": "2.1.2",
"version": "2.1.3",
"description":

@@ -5,0 +5,0 @@ "A module to subscribe to GCM/FCM and receive notifications within a node process.",

@@ -30,3 +30,6 @@ const EventEmitter = require('events');

constructor(credentials, { persistentIds, socketTimeout } = {}) {
constructor(
credentials,
{ persistentIds, socketTimeout, socketKeepAliveDelay } = {}
) {
super();

@@ -36,2 +39,3 @@ this._credentials = credentials;

this._socketTimeout = socketTimeout;
this._socketKeepAliveDelay = socketKeepAliveDelay;
this._retryCount = 0;

@@ -82,3 +86,4 @@ this._onSocketConnect = this._onSocketConnect.bind(this);

this._socket.setKeepAlive(true);
// Set default keep alive delay to 10s to prevent connection drop in electron v20+
this._socket.setKeepAlive(true, this._socketKeepAliveDelay || 10 * 1000);
this._socket.on('connect', this._onSocketConnect);

@@ -85,0 +90,0 @@ this._socket.on('error', this._onSocketError);

@@ -10,3 +10,3 @@ const register = require('./register');

async function listen(credentials, notificationCallback, options = {}) {
const { socketTimeout } = options;
const { socketTimeout, socketKeepAliveDelay } = options;

@@ -38,2 +38,3 @@ if (!credentials) {

socketTimeout,
socketKeepAliveDelay,
});

@@ -40,0 +41,0 @@ client.on('ON_NOTIFICATION_RECEIVED', notificationCallback);