How can I display a retry action without retrying automatically forever?
Quick answer
Set a clear limit for automatic retries, then stop and show a Retry button if the operation still fails. Start another attempt only when the user activates that button. While it runs, show a loading state; on success, show the result, and on failure, return to the error state with the action available again. Make the retry limit and status clear.
The question, the details, the next step.
A practical checklist
Choose a maximum number of automatic attempts for each operation.
Count the initial attempt consistently and stop automatic retries at the stated limit.
Show loading only while an attempt is running; prevent duplicate starts.
After the limit, show a clear failure message and a user-triggered Retry action.
On manual retry, start a new operation and return to the error state if it fails.
Check success and repeated-failure paths to confirm no automatic loop remains.
A few more useful answers
Should the Retry button stay visible while an attempt is running?
Usually disable it or replace it with a loading status while the attempt is in progress. Make it available again if that attempt fails and another user-triggered try is allowed.
Should clicking Retry reset the automatic attempt count?
Treat the click as a new operation and apply your defined automatic-retry limit to that operation. Keep any separate limit on repeated manual retries explicit rather than silently reusing or resetting counts.
What should the interface say when the automatic retry limit is reached?
Say that the operation failed and offer a clear next action, such as “Couldn’t load the report. Try again.” Avoid a spinner or wording that suggests automatic retries are still happening.
