signal: process devices sequentially
This commit is contained in:
+15
-17
@@ -109,26 +109,24 @@ export const parseAndInjectE2ESessions = async (node: BinaryNode, repository: Si
|
|||||||
const chunks = chunk(nodes, chunkSize)
|
const chunks = chunk(nodes, chunkSize)
|
||||||
|
|
||||||
for (const nodesChunk of chunks) {
|
for (const nodesChunk of chunks) {
|
||||||
await Promise.all(
|
for (const node of nodesChunk) {
|
||||||
nodesChunk.map(async (node: BinaryNode) => {
|
const signedKey = getBinaryNodeChild(node, 'skey')!
|
||||||
const signedKey = getBinaryNodeChild(node, 'skey')!
|
const key = getBinaryNodeChild(node, 'key')!
|
||||||
const key = getBinaryNodeChild(node, 'key')!
|
const identity = getBinaryNodeChildBuffer(node, 'identity')!
|
||||||
const identity = getBinaryNodeChildBuffer(node, 'identity')!
|
const jid = node.attrs.jid!
|
||||||
const jid = node.attrs.jid!
|
|
||||||
|
|
||||||
const registrationId = getBinaryNodeChildUInt(node, 'registration', 4)
|
const registrationId = getBinaryNodeChildUInt(node, 'registration', 4)
|
||||||
|
|
||||||
await repository.injectE2ESession({
|
await repository.injectE2ESession({
|
||||||
jid,
|
jid,
|
||||||
session: {
|
session: {
|
||||||
registrationId: registrationId!,
|
registrationId: registrationId!,
|
||||||
identityKey: generateSignalPubKey(identity),
|
identityKey: generateSignalPubKey(identity),
|
||||||
signedPreKey: extractKey(signedKey)!,
|
signedPreKey: extractKey(signedKey)!,
|
||||||
preKey: extractKey(key)!
|
preKey: extractKey(key)!
|
||||||
}
|
}
|
||||||
})
|
|
||||||
})
|
})
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user