fix(types): resolve all TypeScript compilation errors from non-null assertion removal

Fixes:
- chats.ts: revert encodeResult/initial to ! (guaranteed by callback assignment)
- groups.ts: fix operator precedence with ?? (wrap +attrs in parens), fix groupId type
- messages-recv.ts: extract messageKey.id to local const with fallback
- socket.ts: revert onClose! (guaranteed by synchronous callback assignment)
- event-buffer.ts: add 'notify' fallback for MessageUpsertType
- messages.ts: add filePath const after null guard, fix contextInfo type assertion
- noise-handler.ts: restore array index ! (guaranteed by length check)

Build now compiles with zero new errors.

https://claude.ai/code/session_01E2cfX1N3sJgCJBTvzGazSG
This commit is contained in:
Claude
2026-02-09 01:02:13 +00:00
parent d903c57476
commit 6e394bd540
7 changed files with 20 additions and 21 deletions
+6 -5
View File
@@ -156,16 +156,17 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
throw new Boom('Not authenticated')
}
if (await placeholderResendCache.get(messageKey?.id)) {
const msgId = messageKey?.id ?? ''
if (await placeholderResendCache.get(msgId)) {
logger.debug({ messageKey }, 'already requested resend')
return
} else {
await placeholderResendCache.set(messageKey?.id, true)
await placeholderResendCache.set(msgId, true)
}
await delay(2000)
if (!(await placeholderResendCache.get(messageKey?.id))) {
if (!(await placeholderResendCache.get(msgId))) {
logger.debug({ messageKey }, 'message received while resend requested')
return 'RESOLVED'
}
@@ -180,9 +181,9 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
}
setTimeout(async () => {
if (await placeholderResendCache.get(messageKey?.id)) {
if (await placeholderResendCache.get(msgId)) {
logger.debug({ messageKey }, 'PDO message without response after 8 seconds. Phone possibly offline')
await placeholderResendCache.del(messageKey?.id)
await placeholderResendCache.del(msgId)
}
}, 8_000)