Notification icon still appears for removed chat messages (TextChatService)

Currently the only way to remove TextChatService messages on the client is by using OnIncomingMessage and returning a TextChatMessageProperties instance with it’s Text field set to " ". This works “fine” yet has one issue attached to it, despite the message being entirely removed (and the rest of TextChatService noticing the change; not rendering the message, etc.) the notification badge still appears for the deleted message, giving the user the false impression that they have a message to view in the chat which is simply not the case as such message was deleted!


“Chat notification visible, player believes there is a chat message waiting for them”

“Player opens chat confused, there is no chat message in-sight because the message was deleted on their client!”

Reproduction steps:

  1. Have an experience that contains multiple Teams (not necessary for the bug although the code sample provided was designed to allocate for it since it is the easiest way to send a chat message when a player is not focussed on chat. In reality, this bug occurs for all messages that are removed on the client and which are sent when the player is not focussed on chat)
  2. Input the following code into a LocalScript:
local properties = Instance.new("TextChatMessageProperties")
properties.Text = " "
game:GetService("TextChatService").OnIncomingMessage = function(msg : TextChatMessage)
	if msg.Metadata == "Roblox.Team.Success.NowInTeam" then
		return properties
	else
		return nil
	end
end

OR
Just open this Roblox place that conveniently has this all set up already.
Repro.rbxl (45.3 KB)

  1. Attempt to change the player’s team while the player has their chat closed (IE: any state in-where the notification badge would appear if a message were to be sent)
  2. Observe that the user has a notification-icon visible on the chat topbar icon; then toggle-open chat, notice that no attached message is visible since it was removed via our localscript, yet the notification still remains!

Expected behavior

I expect no notification icon to be shown for the removed message, as the message is not visible to the player anymore!

10 Likes

This is such a niche thing with no bad effects so I don’t think it’s gonna be fixed.

3 Likes

Thank you for the report and file! I’ll forward this to the team

6 Likes

Is there really no other way to prevent messages from being sent? This " " thing seems janky. I thought returning nil meant the message was not delivered, but after testing what you said to see if you were right, indeed the message goes through unmutated.

It seems to me like TextChannel.ShouldDeliverCallback, which only works on the server, would make sense to exist on the client too. It could serve as a more explicit way of sinking incoming messages like changed-team or friend-joined messages, along with other scripts that may push chat messages.

This is still an issue. How has this not been resolved? I do find it pretty disruptive as I would like to make sure that some messages aren’t sent (like the Roblox.Team.Success.NowInTeam message in OP’s original post)

this guy was right all along,

one year later and this still isn’t fixed