simpleddp icon indicating copy to clipboard operation
simpleddp copied to clipboard

Session disconnected and loginSessionLost event is not called

Open diavrank opened this issue 2 years ago • 0 comments

Hello @Gregivy , it happens that I have a monitoring application and I am getting a weird behavior, since devices (users) are disconnected after the 3rd or 5th day. In some cases, they're reconnected automatically (this is good) but in other cases they remain offline.

image

I am using socialize:user-presence package to monitor sessions of the devices. This code let me know if a device is connected or disconnected:

UserPresence.onSessionConnected(function(connection, userId) {
	console.log('user-connected: ', userId, ' with IP address: ', connection.clientAddress, 'and connection id: ', connection.id);
});

UserPresence.onSessionDisconnected(function(connection, userId) {
	console.log('user-disconnected: ', userId, ' with IP address: ', connection.clientAddress, 'and connection id: ', connection.id);
});

Notes:

Server:

Client:

  • Simple DDP Client
  • Asus Tinker Boards (SBC) with Debian OS
  • Node 12/14
  • It is worth mentioning that these devices at the moment do not make calls to endpoints (methods and publications), only the time in which they remain with online status is being measured.

I have tested that bahavior on a Windows machine (as a client) and I got the same issue. When the PC is not used for a while (until it gets suspended), I receive in the server a log of disconnected client while in the client doesn't update the connectivity status.

Front-end of web admin is using Vue since they are real users who operate the system.

diavrank avatar Jul 05 '21 00:07 diavrank