Skip to content

Revert profile caching#822

Merged
WouterGritter merged 3 commits intolibdeflatefrom
revert-profile-caching
Mar 29, 2026
Merged

Revert profile caching#822
WouterGritter merged 3 commits intolibdeflatefrom
revert-profile-caching

Conversation

@WouterGritter
Copy link
Copy Markdown
Collaborator

This PR reverts any GameProfile caching and reverts the state of InitialLoginSessionHandler to dc18437.

Before this PR, we already were not caching gameprofiles after 22393b8. This PR just cleans the implementation up to be more aligned with upstream, and it also re-implements a simpler version of the shared HttpClient feature of the previous GameProfile fetching implementation. This way, we can make use of connection pooling, allowing HTTP connections to stay open (for up to 30 seconds by default) for faster subsequent requests.

Caching of GameProfile objects here is inherently flawed here, as we fetch https://sessionserver.mojang.com/session/minecraft/hasJoined, an endpoint which doesn't only return the "official"/proper GameProfile but also performs checks on the serverId we pass, which is cryptographically generated based on the shared secret with the client and the server's public key. We need to perform this check on every online player that tries to join the server to ensure they have a proper online mode account.

Also cherry-picks PaperMC@742bd72 from PaperMC#1754 (Setup encryption before possible disconnect) as we had this behavior implemented here before too.

Revert InitialLoginSessionHandler to the same state as after dc18437
# Conflicts:
#	proxy/src/main/java/com/velocitypowered/proxy/connection/client/InitialLoginSessionHandler.java
@WouterGritter WouterGritter merged commit 9e454e1 into libdeflate Mar 29, 2026
@WouterGritter WouterGritter deleted the revert-profile-caching branch March 29, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant