PaperMC / PaperMC/Paper

PlayerProfile cache completions perform web requests

Open
#14,219 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage version: 26.2
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior
Image
Observed/Actual behavior
Image
Steps/models to reproduce

Just use the method

Plugin and Datapack List

null

Paper version

ver
[04:24:47 INFO]: This server is running Paper version 26.2-120-main@1797fbc (2026-08-28T19:56:08Z) (Implementing API version 26.2.build.120-stable)
You are running the latest version

Other

Possibly:

diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
--- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java    (revision 26b94ad553e32a4fb8f7790e3eef3a6c32b77953)
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java    (date 1787969857353)
@@ -236,7 +236,7 @@
             if (onlineMode) {
                 profile = server.services().paper().filledProfileCache().getIfCached(name);
                 if (profile == null && lookupUUID) {
-                    NameAndId nameAndId = server.services().nameToIdCache().get(name).orElse(null);
+                    NameAndId nameAndId = server.services().nameToIdCache().getIfCached(name);
                     if (nameAndId != null) {
                         profile = nameAndId.toUncompletedGameProfile();
                     }

However I think that there's need to actually rethink the entire method body. I'm not even sure why there's textures check:


        if ((profile.name().isEmpty() || !hasTextures()) && this.getId() != null) {
            GameProfile profile = server.services().paper().filledProfileCache().getIfCached(this.profile.id());
            if (profile == null) {

Also, additional overload would be nice to have if the textures check is actually meant to be there, for example:

public boolean completeFromCache(boolean lookupUUID, boolean textures, boolean onlineMode) {

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java, at completeFromCache(boolean lookupUUID, boolean onlineMode), and trace the filledProfileCache and nameToIdCache calls. Clarify the intended textures and lookupUUID behavior, then verify that cache completion does not perform web requests and that the method behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.