Bug Fix Summary #10

Merged
navicore merged 3 commits from fix-dot-add-timeout into main 2025-11-09 15:36:21 +00:00
navicore commented 2025-11-09 14:07:18 +00:00 (Migrated from github.com)

Problem: The "dot" streaming indicator never disappeared when the backend failed to respond, even after refresh, persisting until a new session was
created.

Root Cause: The is_streaming signal was only cleared when specific error conditions were handled (auth errors, network errors, etc.), but had no
timeout mechanism for when the backend simply hangs without responding.

Solution: Added a 2-minute timeout using gloo_timers::future::TimeoutFuture and futures::select! to race the streaming request against the timeout.

Changes Made (in client/src/components/chat.rs):

  1. Wrapped the entire streaming request logic in a future (request_future)
  2. Created a 120-second timeout future
  3. Used futures::select! to race them
  4. When timeout wins:
    - Clears is_streaming state (fixes the dot)
    - Removes the hanging streaming response cell
    - Adds a helpful error message explaining the timeout

Result:

  • Dot indicator will now automatically disappear after 2 minutes if backend doesn't respond
  • User gets a clear error message: "Request timed out - The AI model didn't respond within 2 minutes..."
  • Normal requests that complete continue to work as before
Problem: The "dot" streaming indicator never disappeared when the backend failed to respond, even after refresh, persisting until a new session was created. Root Cause: The is_streaming signal was only cleared when specific error conditions were handled (auth errors, network errors, etc.), but had no timeout mechanism for when the backend simply hangs without responding. Solution: Added a 2-minute timeout using gloo_timers::future::TimeoutFuture and futures::select! to race the streaming request against the timeout. Changes Made (in client/src/components/chat.rs): 1. Wrapped the entire streaming request logic in a future (request_future) 2. Created a 120-second timeout future 3. Used futures::select! to race them 4. When timeout wins: - Clears is_streaming state (fixes the dot) - Removes the hanging streaming response cell - Adds a helpful error message explaining the timeout Result: - Dot indicator will now automatically disappear after 2 minutes if backend doesn't respond - User gets a clear error message: "Request timed out - The AI model didn't respond within 2 minutes..." - Normal requests that complete continue to work as before
Sign in to join this conversation.
No description provided.