From 2d89c152b1a0ca9a6c466978b929a5a43626dc71 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Wed, 13 Nov 2024 16:14:05 -0800 Subject: [PATCH] Fix conversation sync --- src/app/commands.ts | 11 ++--- src/app/components/ChatItem.svelte | 8 +--- src/app/components/LogIn.svelte | 13 +++++- src/app/components/LogOut.svelte | 3 +- src/routes/+layout.svelte | 72 +++++++++++++++++------------- src/routes/chat/+layout.svelte | 4 +- 6 files changed, 64 insertions(+), 47 deletions(-) diff --git a/src/app/commands.ts b/src/app/commands.ts index bdd6b99..efb39fd 100644 --- a/src/app/commands.ts +++ b/src/app/commands.ts @@ -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})` } } diff --git a/src/app/components/ChatItem.svelte b/src/app/components/ChatItem.svelte index 7ec1dc2..4c4e332 100644 --- a/src/app/components/ChatItem.svelte +++ b/src/app/components/ChatItem.svelte @@ -1,12 +1,10 @@ diff --git a/src/routes/chat/+layout.svelte b/src/routes/chat/+layout.svelte index 589af06..7e433b9 100644 --- a/src/routes/chat/+layout.svelte +++ b/src/routes/chat/+layout.svelte @@ -1,7 +1,7 @@