This commit is contained in:
Finn Dittmar 2026-05-05 14:49:35 -04:00 committed by GitHub
commit 10b0e5b1cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 144 additions and 4 deletions

View file

@ -291,9 +291,11 @@ class SocketAuthority {
client.user = user
this.adminEmitter('user_online', client.user.toJSONForPublic(this.Server.playbackSessionManager.sessions))
// Update user lastSeen without firing sequelize bulk update hooks
user.lastSeen = Date.now()
await user.save({ hooks: false })
if (this.Server.lastSeenManager) {
this.Server.lastSeenManager.addActiveUser(user.id)
// To ensure actual lastSeen behaviour does not change, we just flush when connecting. This should not add much overhead as this is only for the authenticated socket.
this.Server.lastSeenManager.flushActiveUsers()
}
const initialPayload = {
userId: client.user.id,