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:
- 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)
- 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)
- 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)
- 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!