flytegg/mc-utils

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

Closed this issue · 3 comments

Util Name

server-jars

Changes

https://mcutils.com/server-jars

Reproduce

  • Open Server Jars
  • See 'Paper' and '1.21' preloaded into select
  • Hit 'Download'
  • Get served Paper 1.20.4

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

Worse than I thought.

Reproduce

  • Start on Purpur, 1.21
  • Move to Pufferfish
  • Still downloads Purpur (?)

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

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

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.