fix: revert remaining ?? '' patterns across Utils, WABinary, Signal, and WAUSync files
Completes the comprehensive revert of defensive null coalescing patterns introduced in PRs 124-129. These patterns (e.g. `value ?? ''`) silently produced empty strings instead of failing fast, causing subtle bugs like malformed JIDs and broken Signal session lookups. Files: libsignal.ts, messages-recv.ts, chat-utils.ts, generics.ts, history.ts, messages-media.ts, messages.ts, process-message.ts, validate-connection.ts, jid-utils.ts, UsyncBotProfileProtocol.ts https://claude.ai/code/session_01XaA7GwNaB6azTHFYQ8WEpB
This commit is contained in:
@@ -294,7 +294,7 @@ export const processHistoryMessage = (item: proto.IHistorySync, logger?: ILogger
|
||||
case proto.HistorySync.HistorySyncType.FULL:
|
||||
case proto.HistorySync.HistorySyncType.ON_DEMAND:
|
||||
for (const chat of (item.conversations ?? []) as Chat[]) {
|
||||
const chatId = chat.id ?? ''
|
||||
const chatId = chat.id!
|
||||
|
||||
// Source 2: Extract LID-PN mapping from conversation object
|
||||
// This handles cases where the mapping isn't in phoneNumberToLidMappings
|
||||
@@ -371,7 +371,7 @@ export const processHistoryMessage = (item: proto.IHistorySync, logger?: ILogger
|
||||
break
|
||||
case proto.HistorySync.HistorySyncType.PUSH_NAME:
|
||||
for (const c of (item.pushnames ?? [])) {
|
||||
contacts.push({ id: c.id ?? '', notify: c.pushname ?? '' })
|
||||
contacts.push({ id: c.id!, notify: c.pushname! })
|
||||
}
|
||||
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user