Fix conversation sync

This commit is contained in:
Jon Staab
2024-11-13 16:14:05 -08:00
parent da3db67aa6
commit 2d89c152b1
6 changed files with 64 additions and 47 deletions
+6 -5
View File
@@ -283,7 +283,7 @@ export const checkRelayAccess = async (url: string, claim = "") => {
result[url].message?.replace(/^.*: /, "") ||
"join request rejected"
return `Failed to join relay: ${message}`
return `Failed to join relay (${message})`
}
}
@@ -309,11 +309,12 @@ export const checkRelayAuth = async (url: string) => {
const connection = ctx.net.pool.get(url)
const okStatuses = [AuthStatus.None, AuthStatus.Ok]
await connection.auth.attempt(5000)
await connection.auth.attempt(30_000)
if (!okStatuses.includes(connection.auth.status)) {
console.log(connection.auth.status, connection)
return `Failed to authenticate: "${connection.auth.message}"`
// Only raise an error if it's not a timeout.
// If it is, odds are the problem is with our signer, not the relay
if (!okStatuses.includes(connection.auth.status) && connection.auth.message) {
return `Failed to authenticate (${connection.auth.message})`
}
}