Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Blizzero opened this issue Dec 10, 2024 · 0 comments

Comments

@Blizzero
Copy link
Contributor

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant