Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Improve outdated version check

Open Toffikk opened this issue 8 months ago • 20 comments

This pull request improves the outdated build check by querying the api if an update is actually available instead of blindly logging that you haven't updated in a while. And adapts the PaperVersionFetcher.java class to the new fill v3 api with an User-Agent field in the format of

  • Paper/1.21.8-DEV-4e41aad (https://papermc.io)

When the server finishes loading and prints out Done, we query the api asynchronously and return the build status based on the four types below:

  • outdated build & version ultra outdated

  • outdated build image

  • new version available but latest build (for the outdated version) outdated but less

  • up-to-date/the newer version is experimental -> we dont log at all

This check can be disabled by specifying the appropriate system property -Dpaper.disableStartupVersionCheck

Toffikk avatar May 24 '25 23:05 Toffikk

The issue is that we still want that to technically still be there if people are using the "latest" version of lets say 1.20.6, as even tho they are on the latest they obviously still should be encouraged to update.

Owen1212055 avatar May 25 '25 01:05 Owen1212055

@Owen1212055 what about adding a note even if it returns latest to check the build page if there is a new minecraft version and download it? implementing logic to check all that would be kinda complicated

Toffikk avatar May 25 '25 01:05 Toffikk

"It's still recommended you check the build page in case a new minecraft version has been released" something in these lines

Toffikk avatar May 25 '25 01:05 Toffikk

image

~~changed the message to look like this~~ changed it in a later commit again to say "you're running the latest build for your minecraft version!" instead of "you're running the latest version!" to make it clearer

Toffikk avatar May 25 '25 01:05 Toffikk

image2 image1 image

Example outputs for latest as of now

Toffikk avatar May 25 '25 11:05 Toffikk

outdated ->

image image

outdated and new minecraft ver ->

image image

Toffikk avatar May 25 '25 12:05 Toffikk

rebased ontop of 1.21.6 🎇

Toffikk avatar Jun 17 '25 20:06 Toffikk

There appears to be quite a few formatting issues ive noticed; some code isnt indented from its if statement while some is, some if statements have braces while others dont, some code is duplicated inside an if when it could just extract one part of it

The-Epic avatar Jun 19 '25 16:06 The-Epic

There appears to be quite a few formatting issues ive noticed; some code isnt indented from its if statement while some is, some if statements have braces while others dont, some code is duplicated inside an if when it could just extract one part of it

Reformatted and added back the system property 👍

Toffikk avatar Jun 19 '25 17:06 Toffikk

@Y2Kwastaken would you mind reviewing once again now?

Toffikk avatar Jun 19 '25 21:06 Toffikk

Should i also change the references to fill now? and make all of them use an user agent? also what would be the correct channels now for checking if a build is experimental or not

Toffikk avatar Jun 26 '25 20:06 Toffikk

Yes, you should change all API calls to Fill. You can find a new API reference in the Swagger UI, as noted in the announcement: https://fill.papermc.io/swagger-ui/index.html

Strokkur424 avatar Jun 26 '25 20:06 Strokkur424

Migrated 🎇

Toffikk avatar Jun 26 '25 20:06 Toffikk

switched build checking to the /latest endpoint, should be good to review now; i dont foresee any changes other than related to reviews

edit: turns out i could make the logic a bit more readable now with fill so i did that

Toffikk avatar Jun 26 '25 21:06 Toffikk

rebased to 1.21.7

Toffikk avatar Jun 30 '25 15:06 Toffikk

rebased to 1.21.8; also are there any updates on this? would love to see this getting merged soon ^_^

Toffikk avatar Jul 17 '25 19:07 Toffikk

rebased and changed the logic to use optionals instead of nullable strings

Toffikk avatar Sep 13 '25 13:09 Toffikk

Rebased for 1.21.9 🐟🎇

Toffikk avatar Oct 03 '25 13:10 Toffikk

@Toffikk needs rebase for 1.21.10

But LGTM

SnowzNZ avatar Oct 13 '25 22:10 SnowzNZ