WIP: fix: nostr discovery timeout #213

Closed
enes wants to merge 1 commits from hotfix-nostr-discovery-error-9-20 into staging
Showing only changes of commit 3a090cdfd6 - Show all commits

View File

@ -790,11 +790,21 @@ const getUserAppDataFromBlossom = async (url: string, privateKey: string) => {
errorCode = status errorCode = status
} }
// HACK: Timeout issue, blossom server nostr discovery
// Force the error code as the timeout
if (
errorCode === 0 &&
axios.isAxiosError(err) &&
err.code === 'ERR_NETWORK'
) {
errorCode = 504
}
return null return null
}) })
// Return a default value if the requested resource is not found (404) // Return a default value if the requested resource is not found (404)
if (errorCode === 404) { if (errorCode === 404 || errorCode === 504) {
return { return {
sigits: {}, sigits: {},
processedGiftWraps: [] processedGiftWraps: []