fix: ensure proper type casting for cache and message handling

This commit is contained in:
Francisco Pessano
2025-08-14 16:50:03 +00:00
committed by GitHub
parent 84fcd13907
commit b0a973e24c
6 changed files with 16 additions and 15 deletions

View File

@@ -195,8 +195,8 @@ export const makeMessagesSocket = (config: SocketConfig) => {
const user = jidDecode(jid)?.user
jid = jidNormalizedUser(jid)
if (useCache) {
const devices = userDevicesCache.get<JidWithDevice[]>(user!)
if (devices) {
const devices = userDevicesCache.get<JidWithDevice[]>(user!) as JidWithDevice[] | undefined
if (devices && Array.isArray(devices)) {
deviceResults.push(...devices)
logger.trace({ user }, 'using cache for devices')