Merge pull request #23317 from overleaf/bg-improve-real-time-ping-logs

Add connection details to real-time ping logs

GitOrigin-RevId: f993d71deb1a512295af6c7146a19b730742e33f
This commit is contained in:
Brian Gough
2025-02-03 11:04:56 +00:00
committed by Copybot
parent 8246195088
commit 9c6311e071

View File

@@ -235,6 +235,14 @@ module.exports = Router = {
user = { _id: 'anonymous-user', anonymousAccessToken }
}
const connectionDetails = {
userId: user._id,
projectId,
remoteIp: client.remoteIp,
publicId: client.publicId,
clientId: client.id,
}
let pingTimestamp
let pingId = -1
let pongId = -1
@@ -243,8 +251,7 @@ module.exports = Router = {
if (pongId !== pingId) {
logger.warn(
{
publicId: client.publicId,
clientId: client.id,
...connectionDetails,
pingId,
pongId,
lastPingTimestamp: pingTimestamp,
@@ -262,8 +269,7 @@ module.exports = Router = {
if (receivedPingId !== pingId) {
logger.warn(
{
publicId: client.publicId,
clientId: client.id,
...connectionDetails,
receivedPingId,
pingId,
sentTimestamp,
@@ -279,8 +285,7 @@ module.exports = Router = {
) {
logger.warn(
{
publicId: client.publicId,
clientId: client.id,
...connectionDetails,
receivedPingId,
pingId,
sentTimestamp,