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