Description:
When this local error happens, the user of the client on which the error happened can no longer use the chat bar at all, and thus cannot chat. The chat bar stays active but cannot be interacted with, the chat becomes completely unusable until the user rejoins!
The bug started happening a few days ago. I got the first report on Wednesday late afternoon / evening in PST. Since then it has occurred several hundreds or maybe even a thousand times. (this is a low traffic game we are talking about!)
The bug can happen in all games where the default chat is used (not a custom chat).
Repro:
The error seems to happen in the following way:
- User joins the game
- The local chat modules make a connection to the general chat channel
- A chat message is added to the chat
- Some condition is triggered such that some settings/data entries of the channel/message arenât set properly yet
- The local chat command modules try to parse the message
- The command modules throw errors because some values arenât properly set, but the module still try to use them
We cannot reproduce this reliably, which probably means it is some race condition where a message is added to the channel before chat settings (or other remote objects/settings) are retrieved.
The following error(s) appears in output, in this case the error seems to happen in the MeCommandMessage all the time (maybe this is the first module that is being called, or maybe this is the only one which doesnât check for uninitialized message data?):
Error
Chat.ClientChatModules.MessageCreatorModules.MeCommandMessage:30: bad argument #1 to 'sub' (string expected, got nil)
Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain Chat.ClientChatModules.MessageCreatorModules.MeCommandMessage, line 30 - local UpdateTextFunction
Chat.ClientChatModules.MessageCreatorModules.MeCommandMessage, line 37 - field ? Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain.MessageLabelCreator, line 83 - method CreateMessageLabel
Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain.MessageLogDisplay, line 80 - method AddMessage Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain.ChatChannel, line 68 - method AddMessageToChannel
Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain, line 804 - global HandleChannelJoined Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain, line 1031
Error
Requested module experienced an error while loading Players.<PLAYER>.PlayerScripts.ChatScript
Players.<PLAYER>.PlayerScripts.ChatScript, line 15 - local DoEverything Players.<PLAYER>.PlayerScripts.ChatScript, line 130
Full stack trace:
Script 'Players.<PLAYER>.PlayerScripts.ChatScript', Line 15 - local DoEverything
Script 'Players.<PLAYER>.PlayerScripts.ChatScript', Line 130
Script 'Chat.ClientChatModules.MessageCreatorModules.MeCommandMessage', Line 30 - local UpdateTextFunction
Script 'Chat.ClientChatModules.MessageCreatorModules.MeCommandMessage', Line 37 - field ?
Script 'Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain.MessageLabelCreator', Line 83 - method CreateMessageLabel
Script 'Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain.MessageLogDisplay', Line 80 - method AddMessage
Script 'Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain.ChatChannel', Line 68 - method AddMessageToChannel
Script 'Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain', Line 804 - global HandleChannelJoined nil
Script 'Players.<PLAYER>.PlayerScripts.ChatScript.ChatMain', Line 1031
This is the code at the place of error:
The highlighted part seems to be nil, which is why this error happens. This indicates that somewhere, somehow, something was not properly initialized before the chat messages started rolling in through these command modules.
Player feedback log:
- âi press the â/â button to chat, and all it does is make the chat bar appear and desapear, clicking does the same resultâ
- âI keep pressing â/â and it does nothing. meaning i cant chatâ
- âthe chat is broken, it does not get rid of the to chat, click here or press â/â key,â
- âI cant chatâ x50
- âChat is brokenâ x30
- âgame doesnât let me chatâ x5
- âLET ME CHATâ