Changing TeamColor property does not destroy old RBXTeam TextChannel instances

Expected behavior

The Creator Hub’s TextChatService page describes a behavior in which TextChannel instances are added or removed to match when Team instances are added or removed:

Presumably, this setup is designed in a way to ensure nonexistent Teams are not polluting the TextChatService.TextChannels folder with unused TextChannels.

The issue

The intended behavior is to automatically remove team-based TextChannels whose matching TeamColor is no longer held by an active Team.

While this works when creating and destroying Team instances, it falls apart when the developer changes an existing Team’s TeamColor property.

In this example, I am running a Play session in Server mode. Notice how by changing the TeamColor, it creates a new TextChannel, but does not delete the TextChannel associated with the prior TeamColor:

  1. At 0:04, I insert the first Team, which has a White TeamColor by default. A TextChannel named RBXTeamWhite is immediately created to accomodate the new Team.

  2. At 0:12, I change my Player.TeamColor property from Black, which had no associated Team instance, to White, the same TeamColor as the new Team. A new TextSource is automatically created underneath the existing RBXTeamWhite TextChannel, allowing my client to call RBXTeamWhite::SendAsync.

  3. At 0:21, dozens of new TextChannel instances are created as I move my cursor across the TeamColor selection wheel. Even though only one Team exists, and therefore only one valid TeamColor, all the now-unused TeamColors continue to have associated TextChannel instances.

  4. At 0:31, you can see that my Player’s TextSource remains under the RBXTeamWhite channel, despite there no longer being a White Team.

If a Team.TeamColor property is changed, and the old TeamColor property value does not match that of any remaining Teams, the associated RBXTeam TextChannel should be destroyed.

1 Like

There’s an additional issue when there are multiple Teams with the same TeamColor. If one of the duplicate teams is removed, the RBXTeam TextChannel is removed, despite there still being Team(s) with the matching TeamColor.

While the Teams system is not designed to support more than one Team of a given TeamColor, it doesn’t make sense that this TextChannel feature would break as soon as a duplicate Team is a removed.

1 Like

Found someone to look at this! We’ll get back to you when we have an update.

2 Likes