chore: log proto objects to prevent buffer arrays being printed

This commit is contained in:
Adhiraj Singh
2022-04-02 15:44:51 +05:30
parent 8addc714c7
commit 8663598292
2 changed files with 4 additions and 3 deletions

View File

@@ -176,9 +176,10 @@ export const makeSocket = ({
/** connection handshake */
const validateConnection = async() => {
const helloMsg: proto.IHandshakeMessage = {
let helloMsg: proto.IHandshakeMessage = {
clientHello: { ephemeral: ephemeralKeyPair.public }
}
helloMsg = proto.HandshakeMessage.fromObject(helloMsg)
logger.info({ browser, helloMsg }, 'connected to WA Web')

View File

@@ -48,7 +48,7 @@ export const generateLoginNode = (userJid: string, config: ClientPayloadConfig):
username: +user,
device: device,
}
return payload
return proto.ClientPayload.fromObject(payload)
}
export const generateRegistrationNode = (
@@ -89,7 +89,7 @@ export const generateRegistrationNode = (
},
}
return registerPayload
return proto.ClientPayload.fromObject(registerPayload)
}
export const configureSuccessfulPairing = (