use retry routine with force retry

This commit is contained in:
Daniel Lugo 2020-02-24 18:38:12 -04:00
parent a26c00e03a
commit 1ec1ec8b7c

View file

@ -202,11 +202,15 @@ const successfulHandshakeAlreadyExists = async recipientPub => {
* @returns {Promise<string|null>}
*/
const recipientToOutgoingID = async recipientPub => {
const maybeEncryptedOutgoingID = await require('../../Mediator/index')
.getUser()
const maybeEncryptedOutgoingID = await tryAndWait(
(_, user) =>
user
.get(Key.RECIPIENT_TO_OUTGOING)
.get(recipientPub)
.then()
.then(),
// force retry in case undefined is a false negative
v => typeof v === 'undefined'
)
if (typeof maybeEncryptedOutgoingID === 'string') {
const outgoingID = await require('../../Mediator/index').mySEA.decrypt(