Image downloads no longer get stuck - #5422
Open
IlluminPhoenix wants to merge 1 commit into
Open
IlluminPhoenix wants to merge 1 commit into
IlluminPhoenix wants to merge 1 commit into
Conversation
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.
What
When a client requests an image from the server using the
ClientImageCache, if the download fails serverside the server would not notify the client of any fail state and thedownloadingflag would not be reset and staytrue. This prevents any further image requests to the server. This has been fully resolved.Additionally, if the client Minecraft fails to save the image as a texture (
saveTexture) it might fail to resetdownloading. This has been partially resolved.Implementation Details
Added
private final boolean downloadSuccessto SPacketImageResponse packet. Additionally,imagePartis only encoded and decoded if the download did succeed:This means that
imageParthas been moved to the last field and is missing if download has not succeeded.has turned into
since the
saveTexturemethod fails on certain image formats without any exception or any other error indication and does not return to the normal code path. Specifically this line does not return on some image formats (e.g. JPEG):I do not understand how to prevent this issue as this is not mod code. Currently has just been marked as a todo and has been placed last in order of operations to properly clear the download cache and unset the
downloadingflag first to prevent soft locking.AI Usage
Agent Used
ChatGPT WebUI
Agent Usage Description
Partially helping me understand the java code and diagnosing, as well as suggesting fix ideas. All code is human written.
Outcome
Image loading now no longer breaks (e.g. when using the image module in the central monitor) when an image download has failed. Now, after a failed download means new image links will be properly processed and downloaded.
Unsure if there is an issue open for this bug.
How Was This Tested
Tested by using central monitor in game to change between valid download links, invalid links and invalid formats to make sure that valid download links will always work, which they do.
Additional Information: -
Potential Compatibility Issues
Changes to format of
SPacketImageResponse:Before:
Now: