remove success flag from message handler
This commit is contained in:
parent
6a027fb2bc
commit
7d720018f5
|
@ -66,7 +66,7 @@ export function handleWakuMessage(
|
|||
return
|
||||
}
|
||||
|
||||
let success = false
|
||||
client.wakuMessages.add(messageId)
|
||||
|
||||
// decode, map and handle (events)
|
||||
try {
|
||||
|
@ -78,8 +78,6 @@ export function handleWakuMessage(
|
|||
// handle (state and callback)
|
||||
community.handleDescription(decodedPayload)
|
||||
|
||||
success = true
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -99,8 +97,6 @@ export function handleWakuMessage(
|
|||
// handle
|
||||
community.chats.get(chatUuid)?.handleNewMessage(chatMessage)
|
||||
|
||||
success = true
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -114,8 +110,6 @@ export function handleWakuMessage(
|
|||
.get(chatUuid)
|
||||
?.handleEditedMessage(messageId, decodedPayload.text)
|
||||
|
||||
success = true
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -127,8 +121,6 @@ export function handleWakuMessage(
|
|||
|
||||
community.chats.get(chatUuid)?.handleDeletedMessage(messageId)
|
||||
|
||||
success = true
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -142,8 +134,6 @@ export function handleWakuMessage(
|
|||
.get(chatUuid)
|
||||
?.handlePinnedMessage(messageId, decodedPayload.pinned)
|
||||
|
||||
success = true
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -161,23 +151,15 @@ export function handleWakuMessage(
|
|||
`0x${bytesToHex(publicKey)}`
|
||||
)
|
||||
|
||||
success = true
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
default:
|
||||
success = true
|
||||
|
||||
break
|
||||
}
|
||||
} catch {
|
||||
// protons-runtime throws when trying to decode invalid protocol buffers
|
||||
success = true
|
||||
}
|
||||
|
||||
if (success) {
|
||||
client.wakuMessages.add(messageId)
|
||||
// eslint-disable-next-line no-empty
|
||||
}
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue