Skip to content

Commit

Permalink
Merge pull request #2286 from okTurtles/bugfix-enqueue-pubsubevents
Browse files Browse the repository at this point in the history
Enqueue all pubsub events
  • Loading branch information
taoeffect committed Aug 6, 2024
2 parents 63ae0a0 + 7e800b0 commit 21974e5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions shared/domains/chelonia/chelonia.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,14 @@ export default (sbp('sbp/selectors/register', {
console.info(`[chelonia] Discarding pub event for ${msg.channelID} because it's not in the current subscriptionSet`)
return
}
try {
sbp('chelonia/queueInvocation', msg.channelID, () => {
(v: Function)(parseEncryptedOrUnencryptedMessage.call(this, {
contractID: msg.channelID,
serializedData: msg.data
}))
} catch (e) {
}).catch(e => {
console.error(`[chelonia] Error processing pub event for ${msg.channelID}`, e)
}
})
}]
case NOTIFICATION_TYPE.KV:
return [k, (msg) => {
Expand All @@ -592,15 +592,15 @@ export default (sbp('sbp/selectors/register', {
console.info(`[chelonia] Discarding kv event for ${msg.channelID} because it's not in the current subscriptionSet`)
return
}
try {
sbp('chelonia/queueInvocation', msg.channelID, () => {
(v: Function)([msg.key, parseEncryptedOrUnencryptedMessage.call(this, {
contractID: msg.channelID,
meta: msg.key,
serializedData: JSON.parse(Buffer.from(msg.data).toString())
})])
} catch (e) {
}).catch(e => {
console.error(`[chelonia] Error processing kv event for ${msg.channelID} and key ${msg.key}`, e)
}
})
}]
default:
return [k, v]
Expand Down

0 comments on commit 21974e5

Please sign in to comment.