Socket
Socket
Sign inDemoInstall

chainpad-server

Package Overview
Dependencies
4
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.5 to 4.0.6

21

NetfluxWebsocketSrv.js

@@ -130,2 +130,3 @@ /* jshint esversion: 6 */

const dropUser = function (ctx, user, reason) {
if (!user || !user.socket) { return; }
if (user.socket.readyState !== WEBSOCKET_CLOSING

@@ -315,9 +316,13 @@ && user.socket.readyState !== WEBSOCKET_CLOSED)

let u = ctx.users[userId];
if (time - u.timeOfLastMessage > LAG_MAX_BEFORE_DISCONNECT) {
ctx.dropUser(u, "INACTIVITY");
try {
if (time - u.timeOfLastMessage > LAG_MAX_BEFORE_DISCONNECT) {
ctx.dropUser(u, "INACTIVITY");
}
if (!u.pingOutstanding && time - u.timeOfLastMessage > LAG_MAX_BEFORE_PING) {
sendMsg(ctx, u, [0, '', 'PING', now()]);
u.pingOutstanding = true;
}
} catch (err) {
ctx.emit.error(err, 'USER_ACTIVITY_CHECK');
}
if (!u.pingOutstanding && time - u.timeOfLastMessage > LAG_MAX_BEFORE_PING) {
sendMsg(ctx, u, [0, '', 'PING', now()]);
u.pingOutstanding = true;
}
});

@@ -473,4 +478,4 @@ };

ctx.dropUser = function (user, reason) {
dropUser(ctx, user, reason);
ctx.dropUser = function (userId, reason) {
dropUser(ctx, ctx.users[userId], reason);
};

@@ -477,0 +482,0 @@

{
"name": "chainpad-server",
"description": "api backend for realtime collaborative visual editor with zero knowlege server",
"version": "4.0.5",
"version": "4.0.6",
"dependencies": {

@@ -6,0 +6,0 @@ "nthen": "0.1.8",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc