retry on undefined
This commit is contained in:
parent
1ec1ec8b7c
commit
89d1f1bacf
1 changed files with 9 additions and 3 deletions
|
|
@ -104,7 +104,7 @@ const onAcceptedRequests = (user, SEA) => {
|
||||||
throw new TypeError("typeof feedID !== 'string'")
|
throw new TypeError("typeof feedID !== 'string'")
|
||||||
}
|
}
|
||||||
|
|
||||||
const feedIDExistsOnRecipientsOutgoings = await Utils.tryAndWait(
|
const maybeFeedOnRecipientsOutgoings = await Utils.tryAndWait(
|
||||||
gun =>
|
gun =>
|
||||||
new Promise(res => {
|
new Promise(res => {
|
||||||
gun
|
gun
|
||||||
|
|
@ -112,11 +112,17 @@ const onAcceptedRequests = (user, SEA) => {
|
||||||
.get(Key.OUTGOINGS)
|
.get(Key.OUTGOINGS)
|
||||||
.get(feedID)
|
.get(feedID)
|
||||||
.once(feed => {
|
.once(feed => {
|
||||||
res(typeof feed !== 'undefined')
|
res(feed)
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
}),
|
||||||
|
// retry on undefined, might be a false negative
|
||||||
|
v => typeof v === 'undefined'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const feedIDExistsOnRecipientsOutgoings =
|
||||||
|
typeof maybeFeedOnRecipientsOutgoings === 'object' &&
|
||||||
|
maybeFeedOnRecipientsOutgoings !== null
|
||||||
|
|
||||||
if (!feedIDExistsOnRecipientsOutgoings) {
|
if (!feedIDExistsOnRecipientsOutgoings) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue