Skip to content

Fix username duplication in chat when defaultRenderer is explicitly set - #13868

Open
Axyss wants to merge 8 commits into
PaperMC:mainfrom
Axyss:fix/chat-renderer-name-duplication
Open

Axyss wants to merge 8 commits into
PaperMC:mainfrom
Axyss:fix/chat-renderer-name-duplication

Conversation

@Axyss

@Axyss Axyss commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #13574

Explicitly setting the default renderer caused chatTypeKey to be ChatType.CHAT, which rendered the username again on the client.

@Axyss
Axyss requested a review from a team as a code owner May 7, 2026 21:55
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue May 7, 2026

@Warriorrrr Warriorrrr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the best way to resolve this, it would seem better to me to update the check in readModernModifications to avoid setting FORMAT_CHANGED to true if both the original renderer and the new renderer are default ones

@Warriorrrr Warriorrrr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment

@github-project-automation github-project-automation Bot moved this from Awaiting review to Changes required in Paper PR Queue Jul 28, 2026
@Axyss
Axyss requested a review from Warriorrrr July 29, 2026 19:02
@papermc-projects papermc-projects Bot moved this from Changes required to Delayed approval in Paper PR Queue Aug 1, 2026
@Warriorrrr Warriorrrr added type: bug Something doesn't work as it was intended to. scope: api labels Aug 1, 2026
@Lulu13022002

Copy link
Copy Markdown
Contributor

Alternatively this could be solved if defaultRenderer didn't always created a new instance.

@Warriorrrr

Copy link
Copy Markdown
Member

I don't think we could really do that without making it not use ViewerUnawareImpl, a single instance of that can't be re-used multiple times since it caches the message after it's used once

@Lulu13022002

Copy link
Copy Markdown
Contributor

or doing something like 1fd5542

@papermc-projects papermc-projects Bot moved this from Delayed approval to Full approval in Paper PR Queue Aug 16, 2026
@Warriorrrr

Copy link
Copy Markdown
Member

or doing something like 1fd5542

I see what you mean, I think that'd be nice

@Axyss
Axyss force-pushed the fix/chat-renderer-name-duplication branch from 78d358c to 154633d Compare September 29, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: api type: bug Something doesn't work as it was intended to.

Projects

Status: Full approval

Development

Successfully merging this pull request may close these issues.

Using defaultRenderer causes unexpected result in AsyncChatEvent

3 participants