Fix #202 slow-network invite timeout handling #207

Merged
hodlbod merged 2 commits from priyanshu_bharti/flotilla:fix/issue-202-slow-network-invite-timeout into dev 2026-04-15 22:01:01 +00:00
Contributor

Fix #202: Slow networks break invite codes

Problem

On slow or unstable networks, creating an invite could time out before receiving a claim code.

The invite claim request used a short timeout and did not reliably guarantee state cleanup when the request path stalled. This could leave users stuck on a loading spinner.

What changed

Updated src/app/components/SpaceInvite.svelte

  • Wrapped invite claim request flow in try/catch
  • Added finally block to always reset loading state
  • Increased request timeout to 10 seconds
  • Added an explicit timeout race guard so the flow fails fast even if abort signaling does not settle the request
  • Preserved graceful fallback to claimless invite links by setting claim to an empty string on failure

Behavior after fix

  • Invite creation no longer gets stuck on an infinite spinner on slow/offline conditions
  • If claim fetch fails or times out, users still get a usable invite link (claimless fallback)

Manual verification

  1. Open app locally and navigate to Create Invite
  2. Throttle network to a very slow profile
  3. Open Create Invite modal
  4. Confirm spinner stops and invite link appears after timeout window
  5. Switch network to Offline and repeat
  6. Confirm fallback still renders and spinner does not hang

Scope

  • Single-file change
  • No API contract changes
  • No UI design changes
# Fix #202: Slow networks break invite codes ## Problem On slow or unstable networks, creating an invite could time out before receiving a claim code. The invite claim request used a short timeout and did not reliably guarantee state cleanup when the request path stalled. This could leave users stuck on a loading spinner. ## What changed Updated [src/app/components/SpaceInvite.svelte](src/app/components/SpaceInvite.svelte) - Wrapped invite claim request flow in try/catch - Added finally block to always reset loading state - Increased request timeout to 10 seconds - Added an explicit timeout race guard so the flow fails fast even if abort signaling does not settle the request - Preserved graceful fallback to claimless invite links by setting claim to an empty string on failure ## Behavior after fix - Invite creation no longer gets stuck on an infinite spinner on slow/offline conditions - If claim fetch fails or times out, users still get a usable invite link (claimless fallback) ## Manual verification 1. Open app locally and navigate to Create Invite 2. Throttle network to a very slow profile 3. Open Create Invite modal 4. Confirm spinner stops and invite link appears after timeout window 5. Switch network to Offline and repeat 6. Confirm fallback still renders and spinner does not hang ## Scope - Single-file change - No API contract changes - No UI design changes
Author
Contributor

Hi @hodlbod,
I’ve fixed Issue #202 (Slow networks break invite codes).
I properly tested it with heavy network throttling (Slow 3G + custom high latency).
Added try/catch + finally block in SpaceInvite.svelte, increased timeout to 10 seconds, and ensured graceful fallback on error/timeout.
The infinite spinner issue is now resolved.
PR is ready for review.
Thanks!

Hi @hodlbod, I’ve fixed Issue #202 (Slow networks break invite codes). I properly tested it with heavy network throttling (Slow 3G + custom high latency). Added try/catch + finally block in SpaceInvite.svelte, increased timeout to 10 seconds, and ensured graceful fallback on error/timeout. The infinite spinner issue is now resolved. PR is ready for review. Thanks!
hodlbod reviewed 2026-04-15 21:00:18 +00:00
@@ -53,0 +49,4 @@
}),
sleep(10000).then(() => {
throw new Error("Invite claim timed out")
}),
Owner

Do we need this? The timeout signal should abort the request with no events, which means the claim would be set to an empty string in any case. I think this is over-complicating it and increasing the timeout to 10s would be sufficient

Do we need this? The timeout signal should abort the request with no events, which means the claim would be set to an empty string in any case. I think this is over-complicating it and increasing the timeout to 10s would be sufficient
Author
Contributor

Youre right , i removed the extra timeout race and left the request abort signal to handle the timeout. Thanks for the feedback

Youre right , i removed the extra timeout race and left the request abort signal to handle the timeout. Thanks for the feedback
priyanshu_bharti marked this conversation as resolved
hodlbod added 2 commits 2026-04-15 22:00:55 +00:00
hodlbod force-pushed fix/issue-202-slow-network-invite-timeout from 7c2897b65d to ae86b8e6b4 2026-04-15 22:00:55 +00:00 Compare
hodlbod merged commit 43fb3d35e6 into dev 2026-04-15 22:01:01 +00:00
hodlbod deleted branch fix/issue-202-slow-network-invite-timeout 2026-04-15 22:01:01 +00:00
Sign in to join this conversation.