Skip to content

invoking retrieveCookie(NamespacedKey) with the same namespace twice deletes the first retrive from the map, resulting in kicks #14211

Description

@Outfluencer

Expected behavior

When calling retrieveCookie(NamespacedKey) twice, both futures should be completed and the client should not be kicked.

Currently

@Override
public void handleCookieResponse(ServerboundCookieResponsePacket packet) {
    if (this.paperConnection().handleCookieResponse(packet)) return; // Paper
    this.disconnect(DISCONNECT_UNEXPECTED_QUERY, io.papermc.paper.connection.DisconnectionReason.INVALID_COOKIE); // Paper - kick event cause
}

kicks the player.

Because the second retrieveCookie call overrides the first because its a map, then when both cookies arrive the last one is not handled

private final Map<Identifier, CookieFuture> requestedCookies = new ConcurrentHashMap<>();

Observed/Actual behavior

Kick for Component.translatable("multiplayer.disconnect.unexpected_query_response")

Steps/models to reproduce

retriving the same cookie twice directly

Plugin and Datapack List

Paper version

latest

Other

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions