Open
Description
The problem I am facing
It's a bit confusing that there is a connection
key in various hook payloads that is either a Connection
instance or a ConnectionConfiguration
object. Both are quite different:
Connection
webSocket: WebSocket
context: any
document: Document
pingInterval: NodeJS.Timeout
pongReceived = true
request: HTTPIncomingMessage
timeout: number
callbacks: any
socketId: string
lock: AsyncLock
readOnly: Boolean
logger: Debugger
ConnectionConfiguration
readOnly: boolean
requiresAuthentication: boolean
isAuthenticated: boolean
But they appear to be the same at first glance:
onConnect({connection}) {
// connection is ConnectionConfiguration
})
beforeHandleMessage({connection}) {
// connection is Connection
})
The solution I would like
It would be great if ConnectionConfiguration
were always connectionConfig
and Connection
were always connection
.