moxin-org / moly

Moly: an AI LLM GUI app in pure Rust
https://www.moxin.app
Apache License 2.0
160 stars 19 forks source link

Automatic Retry for Download Failures with Backoff Strategy #287

Open joulei opened 1 month ago

joulei commented 1 month ago

Problem

Currently, when a download fails in Moly, users are shown an error message with a button to retry manually. This requires user intervention and doesn’t account for temporary network issues or other transient errors (specially annoying for big downloads when using VPNs).

Proposed Solution

Implement an automatic retry mechanism for failed downloads. This feature should include the following:

  1. Retry Attempts: Attempt to retry failed downloads automatically up to 3 times.
  2. Backoff Strategy: Introduce increasing wait times between retries. Suggested intervals are:
    • 15 seconds before the first retry.
    • 30 seconds before the second retry.
    • 60 seconds before the final retry.
  3. User Feedback: Update the error popup during each retry attempt to display a message like “Retrying in X seconds.” This will provide clear feedback to the user on the current retry status.
  4. Final State If all retries fail, the app should revert to the standard error message with a retry button, allowing the user to manually intervene if needed.
Guocork commented 1 month ago

@joulei Hello,I’ve completed this issue and tested it,it works fine. #289

However, due to some timing issues with the cx.start_timeout on Linux, it hasn’t met the expected results yet. You might need to fix the problem on Makepad first.