From f84f13e104117bdec5ffab4d554bdfc39b3743a5 Mon Sep 17 00:00:00 2001 From: Ketasaja Date: Fri, 3 Jan 2025 18:26:13 +0000 Subject: [PATCH 1/4] Warn about client-side tags being dropped --- content/en-us/reference/engine/classes/CollectionService.yaml | 2 ++ content/en-us/reference/engine/classes/Instance.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/content/en-us/reference/engine/classes/CollectionService.yaml b/content/en-us/reference/engine/classes/CollectionService.yaml index 3aefa0382..337dd80d0 100644 --- a/content/en-us/reference/engine/classes/CollectionService.yaml +++ b/content/en-us/reference/engine/classes/CollectionService.yaml @@ -51,6 +51,8 @@ methods: signal created by `Class.CollectionService:GetInstanceAddedSignal()` with the given tag. + **Warning:** An instance's tags that were added client-side will be dropped if the server later adds or removes a tag on that instance, because the server replicates all tags together and overwrites previous tags. + **Warning:** When tagging an instance, it is common that some resources are used to give the tag its functionality, e.g. event connections or tables. To prevent memory leaks, it is a good idea to clean these up diff --git a/content/en-us/reference/engine/classes/Instance.yaml b/content/en-us/reference/engine/classes/Instance.yaml index 57fda7d7e..863a4b79a 100644 --- a/content/en-us/reference/engine/classes/Instance.yaml +++ b/content/en-us/reference/engine/classes/Instance.yaml @@ -321,6 +321,8 @@ methods: already applied. Successfully adding a tag will fire a signal created by `Class.CollectionService:GetInstanceAddedSignal()` with the given tag. + **Warning:** An instance's tags that were added client-side will be dropped if the server later adds or removes a tag on that instance, because the server replicates all tags together and overwrites previous tags. + Note that when tagging an instance, it's common that some resources are used to give the tag its functionality, for example event connections or tables. To prevent memory leaks, it's a good idea to clean these up From 6e6a085d4c6cffa4f448dcba0d7e579d56d8ea54 Mon Sep 17 00:00:00 2001 From: IgnisRBX <43388550+IgnisRBX@users.noreply.github.com> Date: Mon, 6 Jan 2025 09:51:52 -1000 Subject: [PATCH 2/4] Apply suggestions from code review --- .../reference/engine/classes/CollectionService.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/content/en-us/reference/engine/classes/CollectionService.yaml b/content/en-us/reference/engine/classes/CollectionService.yaml index 337dd80d0..a66710128 100644 --- a/content/en-us/reference/engine/classes/CollectionService.yaml +++ b/content/en-us/reference/engine/classes/CollectionService.yaml @@ -51,11 +51,15 @@ methods: signal created by `Class.CollectionService:GetInstanceAddedSignal()` with the given tag. - **Warning:** An instance's tags that were added client-side will be dropped if the server later adds or removes a tag on that instance, because the server replicates all tags together and overwrites previous tags. + ##### Warnings + + - An instance's tags that were added client-side will be dropped if the server + later adds or removes a tag on that instance, because the server replicates all + tags together and overwrites previous tags. - **Warning:** When tagging an instance, it is common that some resources - are used to give the tag its functionality, e.g. event connections or - tables. To prevent memory leaks, it is a good idea to clean these up + - When tagging an instance, it is common that some resources + are used to give the tag its functionality, for example event connections or + tables. To prevent memory leaks, it's a good idea to clean these up (disconnect, set to nil, etc) when no longer needed for a tag. Do this when calling `Class.CollectionService:RemoveTag()`, calling `Class.Instance:Destroy()` or in a function connected to a signal returned From 57c98f8e78037f4fa34f8a1ae105c447eed3a162 Mon Sep 17 00:00:00 2001 From: IgnisRBX <43388550+IgnisRBX@users.noreply.github.com> Date: Mon, 6 Jan 2025 09:54:52 -1000 Subject: [PATCH 3/4] Apply suggestions from code review --- .../en-us/reference/engine/classes/CollectionService.yaml | 2 +- content/en-us/reference/engine/classes/Instance.yaml | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/content/en-us/reference/engine/classes/CollectionService.yaml b/content/en-us/reference/engine/classes/CollectionService.yaml index a66710128..1c79b7f72 100644 --- a/content/en-us/reference/engine/classes/CollectionService.yaml +++ b/content/en-us/reference/engine/classes/CollectionService.yaml @@ -60,7 +60,7 @@ methods: - When tagging an instance, it is common that some resources are used to give the tag its functionality, for example event connections or tables. To prevent memory leaks, it's a good idea to clean these up - (disconnect, set to nil, etc) when no longer needed for a tag. Do this + (disconnect, set to `nil`, etc.) when no longer needed for a tag. Do this when calling `Class.CollectionService:RemoveTag()`, calling `Class.Instance:Destroy()` or in a function connected to a signal returned by `Class.CollectionService:GetInstanceRemovedSignal()`. diff --git a/content/en-us/reference/engine/classes/Instance.yaml b/content/en-us/reference/engine/classes/Instance.yaml index 863a4b79a..26a076f58 100644 --- a/content/en-us/reference/engine/classes/Instance.yaml +++ b/content/en-us/reference/engine/classes/Instance.yaml @@ -321,9 +321,13 @@ methods: already applied. Successfully adding a tag will fire a signal created by `Class.CollectionService:GetInstanceAddedSignal()` with the given tag. - **Warning:** An instance's tags that were added client-side will be dropped if the server later adds or removes a tag on that instance, because the server replicates all tags together and overwrites previous tags. + ##### Warnings + + - An instance's tags that were added client-side will be dropped if the server + later adds or removes a tag on that instance, because the server replicates + all tags together and overwrites previous tags. - Note that when tagging an instance, it's common that some resources are + - When tagging an instance, it is common that some resources are used to give the tag its functionality, for example event connections or tables. To prevent memory leaks, it's a good idea to clean these up (disconnect, set to `nil`, etc.) when no longer needed for a tag. Do this From 62e5b962754c50e430a61d9b0d7865c9452b8cec Mon Sep 17 00:00:00 2001 From: IgnisRBX <43388550+IgnisRBX@users.noreply.github.com> Date: Mon, 6 Jan 2025 09:56:19 -1000 Subject: [PATCH 4/4] Apply suggestions from code review --- content/en-us/reference/engine/classes/CollectionService.yaml | 2 +- content/en-us/reference/engine/classes/Instance.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en-us/reference/engine/classes/CollectionService.yaml b/content/en-us/reference/engine/classes/CollectionService.yaml index 1c79b7f72..63d72de06 100644 --- a/content/en-us/reference/engine/classes/CollectionService.yaml +++ b/content/en-us/reference/engine/classes/CollectionService.yaml @@ -54,7 +54,7 @@ methods: ##### Warnings - An instance's tags that were added client-side will be dropped if the server - later adds or removes a tag on that instance, because the server replicates all + later adds or removes a tag on that instance because the server replicates all tags together and overwrites previous tags. - When tagging an instance, it is common that some resources diff --git a/content/en-us/reference/engine/classes/Instance.yaml b/content/en-us/reference/engine/classes/Instance.yaml index 26a076f58..3965885a2 100644 --- a/content/en-us/reference/engine/classes/Instance.yaml +++ b/content/en-us/reference/engine/classes/Instance.yaml @@ -324,7 +324,7 @@ methods: ##### Warnings - An instance's tags that were added client-side will be dropped if the server - later adds or removes a tag on that instance, because the server replicates + later adds or removes a tag on that instance because the server replicates all tags together and overwrites previous tags. - When tagging an instance, it is common that some resources are