Skip to content

Component: Fails to properly cleanup when tag is added and removed in short timeframe #214

@Blizzero

Description

@Blizzero

Assuming a properly defined Component Class with the tag "Box" and a Part named "myBox" in the Workspace, the following operations unexpectedly result in differing outcomes:

-- Works as expected.
myBox:AddTag("Box")
task.wait()
myBox:RemoveTag("Box")

-- Performs Construct and Start. Fails to call Stop and associated backend cleanup operations.
myBox:AddTag("Box")
myBox:RemoveTag("Box")

-- Performs Construct. Fails to call Start and Stop.
myBox:AddTag("Box")
task.defer(function()
	myBox:RemoveTag("Box")
end)

This issue has low impact. Potential solutions include adding this information to the documentation, throwing an error in InstanceTagged if the instance is missing the tag (solves the 2nd example) and doing the same in TryConstructComponent (solves the 3rd example), or providing support by short cutting to cleanup. This should not be supported in my opinion, and performing any of these actions should throw an error (solution 2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions