Retry a failed image fetch instead of giving up for the session - #18
Merged
Merged
Conversation
A portrait that would not stay put between restarts was never a saving problem. The picture was on the server the whole time. ImageCache set Failed on the first unsuccessful fetch and never cleared it, so an image that failed once was dead until the plugin reloaded. The commonest cause is the card being drawn before the plugin has finished connecting, or a blink of network at login -- half a second of bad luck turning into a picture that never appears again that session. Restarting the game built a new cache, which is why it looked like the photo failed to persist and then came back. Fetches now retry with a backoff of 2, 4, 8, 16, 32 then 60 seconds, and a success clears the count. Cancellation during unload is no longer recorded as a failure, since it poisons an entry for a cache that is about to be discarded. The frame also stops lying. It said "Loading..." whether a fetch was in flight or had given up entirely, which is worse than an empty frame because the reader cannot act on it. After three failures it says "Picture unavailable". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A portrait that would not stay put between game restarts was never a saving problem. The picture was on the server the whole time.
ImageCachesetFailedon the first unsuccessful fetch and never cleared it:So an image that failed once was dead until the plugin reloaded. The commonest cause is the card being drawn before the plugin has finished connecting, or a blink of network at login — half a second of bad luck turning into a picture that never appears again that session. Restarting the game built a fresh cache, which is exactly why it looked like the photo failed to persist and then came back.
Changes
OperationCanceledExceptionduring unload is no longer recorded as a failure — it poisoned an entry for a cache about to be discarded.Loadingflag prevents a retry starting a second concurrent fetch.🤖 Generated with Claude Code