Skip to content

Commit eaddbfe

Browse files
authored
Warn about client-side tags being dropped (#967)
## Changes This behavior can cause unexpected removal of tags added locally. ## Checks By submitting your pull request for review, you agree to the following: - [x] This contribution was created in whole or in part by me, and I have the right to submit it under the terms of this repository's open source licenses. - [x] I understand and agree that this contribution and a record of it are public, maintained indefinitely, and may be redistributed under the terms of this repository's open source licenses. - [x] To the best of my knowledge, all proposed changes are accurate. ---------
1 parent 6320993 commit eaddbfe

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

content/en-us/reference/engine/classes/CollectionService.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,16 @@ methods:
5151
signal created by `Class.CollectionService:GetInstanceAddedSignal()` with
5252
the given tag.
5353
54-
**Warning:** When tagging an instance, it is common that some resources
55-
are used to give the tag its functionality, e.g. event connections or
56-
tables. To prevent memory leaks, it is a good idea to clean these up
57-
(disconnect, set to nil, etc) when no longer needed for a tag. Do this
54+
##### Warnings
55+
56+
- An instance's tags that were added client-side will be dropped if the server
57+
later adds or removes a tag on that instance because the server replicates all
58+
tags together and overwrites previous tags.
59+
60+
- When tagging an instance, it is common that some resources
61+
are used to give the tag its functionality, for example event connections or
62+
tables. To prevent memory leaks, it's a good idea to clean these up
63+
(disconnect, set to `nil`, etc.) when no longer needed for a tag. Do this
5864
when calling `Class.CollectionService:RemoveTag()`, calling
5965
`Class.Instance:Destroy()` or in a function connected to a signal returned
6066
by `Class.CollectionService:GetInstanceRemovedSignal()`.

content/en-us/reference/engine/classes/Instance.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,13 @@ methods:
321321
already applied. Successfully adding a tag will fire a signal created by
322322
`Class.CollectionService:GetInstanceAddedSignal()` with the given tag.
323323
324-
Note that when tagging an instance, it's common that some resources are
324+
##### Warnings
325+
326+
- An instance's tags that were added client-side will be dropped if the server
327+
later adds or removes a tag on that instance because the server replicates
328+
all tags together and overwrites previous tags.
329+
330+
- When tagging an instance, it is common that some resources are
325331
used to give the tag its functionality, for example event connections or
326332
tables. To prevent memory leaks, it's a good idea to clean these up
327333
(disconnect, set to `nil`, etc.) when no longer needed for a tag. Do this

0 commit comments

Comments
 (0)