"Create Invite" shows wrong error message when offline #204
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When a user is offline, the "Create an Invite" modal incorrectly displays:
"Oops! It looks like you're not a member of this relay."
This is misleading because the user is a member — the request simply failed due to no network connectivity.
Expected Behavior:
Show a network-aware message like:
"Unable to reach the relay. Please check your connection and try again."
Root Cause:
In SpaceInvite.svelte, the component checks $authError (from deriveRelayAuthError) to decide what to show. However, this flag gets set to true for any failed request — including offline failures — so offline errors are incorrectly treated as "not a member" errors.
Hi @hodlbod , i want to work on this issue
In SpaceInvite.svelte, I added navigator.onLine state tracked via window online/offline events. Now the template checks !isOnline before $authError, showing "You appear to be offline" instead of the misleading "not a member of this relay" message when the user has no network connection.
Good catch @DeveshSingh, the issue is real, but your
navigator.onLinelogic seems to be a decent quick fix, butnavigator.onLineis heuristic. It can still be true while relay is unreachable (DNS issues, captive portal, relay down, partial connectivity), so wrong messaging can still happen.See this: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine
and also from the image you have shared, make the actual error text to be center aligned, that will feel good UI-wise.
Good point — I moved away from relying on navigator.onLine and now classify errors based on request failures (including timeout). Auth errors are only shown when explicitly detected, and other cases fall back to a generic error.
And I have centered the error message.
@userAdityaa