force retry
This commit is contained in:
parent
7ef3a9cb7f
commit
a26c00e03a
1 changed files with 12 additions and 10 deletions
|
|
@ -159,18 +159,20 @@ const pubToEpub = async pub => {
|
||||||
* @returns {Promise<string|null>}
|
* @returns {Promise<string|null>}
|
||||||
*/
|
*/
|
||||||
const recipientPubToLastReqSentID = async recipientPub => {
|
const recipientPubToLastReqSentID = async recipientPub => {
|
||||||
const lastReqSentID = await tryAndWait(async (_, user) => {
|
const maybeLastReqSentID = await tryAndWait(
|
||||||
const userToLastReqSent = user.get(Key.USER_TO_LAST_REQUEST_SENT)
|
(_, user) => {
|
||||||
const data = await userToLastReqSent.get(recipientPub).then()
|
const userToLastReqSent = user.get(Key.USER_TO_LAST_REQUEST_SENT)
|
||||||
|
return userToLastReqSent.get(recipientPub).then()
|
||||||
|
},
|
||||||
|
// retry on undefined, in case it is a false negative
|
||||||
|
v => typeof v === 'undefined'
|
||||||
|
)
|
||||||
|
|
||||||
if (typeof data !== 'string') {
|
if (typeof maybeLastReqSentID !== 'string') {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return data
|
return maybeLastReqSentID
|
||||||
})
|
|
||||||
|
|
||||||
return lastReqSentID
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue