Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
chore: normalize msg before emit
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Aug 19, 2020
1 parent c9cc4ec commit e905864
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pubsub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,13 @@ class PubsubBaseProtocol extends EventEmitter {
topicIDs: [topic]
}

// ensure that any operations performed on the message will include the signature
const outMsg = await this._buildMessage(msgObject)
msgObject = utils.normalizeInRpcMessage(outMsg)

// Emit to self if I'm interested and emitSelf enabled
this.emitSelf && this._emitMessage(msgObject)

// ensure that any operations performed on the message will include the signature
msgObject = await this._buildMessage(msgObject)

// send to all the other peers
await this._publish(msgObject)
}
Expand Down

0 comments on commit e905864

Please sign in to comment.