improve: add warning logs to null guards and fix transferDevice error handling
- Add warning/debug logs to all null guard patterns (if (!x) return/continue) so that when these guards fire, the reason is visible in logs instead of being silently swallowed - Fix jid-utils.ts transferDevice: throw Error instead of returning empty string '' which could propagate as an invalid JID - process-message.ts: warn on creds.me missing, reactionKey missing, creationMsgKey missing, eventCreatorPn missing - chats.ts: warn on sendPresenceUpdate/handlePresenceUpdate missing values - event-buffer.ts: debug on chat/contact/group update missing id - socket.ts: debug on sessionStartTime not set - communities.ts: debug on dirty node not found - libsignal.ts: warn on bulk migration jidDecode failure https://claude.ai/code/session_01XaA7GwNaB6azTHFYQ8WEpB
This commit is contained in:
@@ -131,7 +131,7 @@ export const transferDevice = (fromJid: string, toJid: string) => {
|
||||
const deviceId = fromDecoded?.device || 0
|
||||
const toDecoded = jidDecode(toJid)
|
||||
if (!toDecoded) {
|
||||
return ''
|
||||
throw new Error(`transferDevice: failed to decode toJid "${toJid}"`)
|
||||
}
|
||||
|
||||
const { server, user } = toDecoded
|
||||
|
||||
Reference in New Issue
Block a user