flytegg / mc-utils

Community powered Minecraft utilities for developers, builders and players.
https://mcutils.com
28 stars 16 forks source link

[Util Change]: Initial highest version should not be hardcoded on Server Jars frontend #217

Closed stephendotgg closed 2 months ago

stephendotgg commented 2 months ago

Util Name

server-jars

Changes

https://mcutils.com/server-jars

Reproduce

Literally only affects the very first download, which in this case we make as Paper + highest avaliable version. Problem is we seem to have a sticky hardcoded variable (1.20.4) which serves the 1.20.4 jar instead of the displayed 1.21 jar.

This fixes itself when you switch platform or version. It is only isolated to first load of the page. Meaning a user cannot download Paper 1.21 without switching platform or version.

We need to make it so the initial variable which is used to serve a jar is Paper + highest avaliable version, not Paper + 1.20.4. This should be a quick change as clearly the select is able to display the correct version.

Extra Info

No response

stephendotgg commented 2 months ago

Worse than I thought.

Reproduce

Needs gutted out and fixed. Going to ditch those one line functions because they are not maintable.

Tofpu commented 2 months ago

I may be mistaken, but from what it seems, it looks like a race condition is happening here. This is reproducible with every platform if you click quick enough. The async functions doesn't look good

stephendotgg commented 2 months ago

Fixed. Just rewrote the JS, quicker than pulling out all those bugs.

Also made it so we build the download links locally now. Much faster.