schema check for incomplete data
This commit is contained in:
parent
f97a110392
commit
d1b6b238bf
1 changed files with 9 additions and 0 deletions
|
|
@ -343,6 +343,11 @@ const processOutgoings = async () => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Schema.isPartialOutgoing(out)) {
|
||||||
|
// incomplete data
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof currentOutgoings[id] === 'undefined') {
|
if (typeof currentOutgoings[id] === 'undefined') {
|
||||||
// We disable this rule because we are awaiting the result of the whole
|
// We disable this rule because we are awaiting the result of the whole
|
||||||
// for each AND each callback looks only at one single ID
|
// for each AND each callback looks only at one single ID
|
||||||
|
|
@ -364,6 +369,10 @@ const processOutgoings = async () => {
|
||||||
await Utils.asyncForEach(
|
await Utils.asyncForEach(
|
||||||
Object.entries(out.messages),
|
Object.entries(out.messages),
|
||||||
async ([msgID, msg]) => {
|
async ([msgID, msg]) => {
|
||||||
|
if (!Schema.isMessage(msg)) {
|
||||||
|
// incomplete data
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!currentOut.messages[msgID]) {
|
if (!currentOut.messages[msgID]) {
|
||||||
let decryptedBody = ''
|
let decryptedBody = ''
|
||||||
if (msg.body === Actions.INITIAL_MSG) {
|
if (msg.body === Actions.INITIAL_MSG) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue