fix(app): make MC <1.12.2 downloadable again #4494
Merged
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.
PR #4270 modified the internal
fetchfunction used by the application to download version artifacts in a way that 4xx HTTP errors also caused an abnormal return, instead of just 5xx errors. That was a good change, but it had the unintended side effect of exposing our faulty logic elsewhere of trying to download non-native JAR library artifacts when only native artifacts are appropriate, at least according to the PrismLauncher source code I've read. Such a download always returned a 404 error, but because such error was considered successful, a dummy library file was still created and things worked seemingly fine.These changes bring the Modrinth App behavior in this regard more in line with PrismLauncher's, avoiding downloading non-native artifacts for dependencies that have native artifacts available. (Reference: https://github.com/PrismLauncher/PrismLauncher/blob/8b5e91920dda7324ad3db98f56b209bba0f4e57d/launcher/minecraft/Library.cpp#L163)
I've tested these changes to work successfully with a variety old Minecraft versions, including Fabric 1.14, vanilla 1.8.9, vanilla 1.13.2, Forge 1.12.2, vanilla 1.19, and vanilla 1.2.5.
Fixes #4464.