De-Sync Bugs with Instance Replication Fix

I am a bit confused, in the example of the old behavior, you state that after the local script runs, then the server removes partA, there is a lingering reference. However, I thought once a script ended, any references were removed?

3 Likes

Astute observation: The example is just a stand-in, assume that the print statement is actually some arbitrary real work which keeps the script doing stuff and actively holding onto the reference.

4 Likes

oh ok, I … sort of … assumed that was the case, but just wanted to make sure.
Thanks for the clarification.

2 Likes

Is the current behavior maybe being exploited with the trick parenting a character to Lighting, and modifying or switching it somehow?

2 Likes

In your folder example, what happens if the client retains a reference to that folder? Is it destroyed by the client as soon as it’s parented to nil by the server or is it just parented to nil on the client as well?

If the latter, wouldn’t that be a memory issue since instances aren’t gced unless destroyed?

2 Likes

The new behavior does not call Destroy() - it just parents to nil on the Client for symmetric behavior, and like you pointed out, this could result in a memory leak.

Though doing something like Destroy() on the Client-side might be an elegant solution for some use cases, there are also definitely cases that it breaks. What if the Client intentionally has a LocalScript holding a reference to Folder, because they need it for a script? What if the Server decides to bring Folder back into the DM later in the experience, but the Client can’t because Folder’s parent has been locked via Destroy()?

We designed this change under the assumption that if a Dev does write a LocalScript to have a lingering reference to an Instance that was removed on Server, that it must be intentional.

3 Likes

But maybe we are thinking that something is the audio that Roblox uploaded

1 Like

I’m unsure if this issue is related to this update, but as of recently parenting guis from replicated storage into player gui is automatically destroying the guii in studio, but works in-game.

2 Likes

That might be related - do you have a simple repro you could share?

2 Likes

GuiBug.rbxl (34.6 KB)

3 Likes

This documentation suggests that PlayerGui gets reset whenever the Character gets loaded. If I change the LocalScript in the repro to do this:

local PlayerGui = game:GetService("Players").LocalPlayer.PlayerGui
local Gui = game:GetService("ReplicatedStorage").ScreenGui

local Player = game:GetService('Players').LocalPlayer

Player.CharacterAdded:Wait()

Gui.Parent = PlayerGui

Then the reparenting works, at least on my end.

I’m not totally sure why the repro without the wait works in-game today though…

2 Likes

Isn’t the reset behavior based on the ResetOnSpawn property of the screen gui? Also, it still works if you disable CharacaterAutoLoads and add the wait, so I don’t think it is based on the character loading.

2 Likes

Here is a repro with character loading disabled and still works with the wait added.
GuiBug.rbxl (35.1 KB)

2 Likes

Hmm you’re right. I’ll investigate and update this thread, thanks!

2 Likes

Thank you for the report! It looks like this change has an adverse impact on adding to PlayerGui this way, so I’ll be rolling the changes back for now. I will update this thread again when this is fixed.

Thanks for your patience!

6 Likes

Any update or ETA on when this will be rolled back?
This change has also broken my game and is causing disruption to players while we wait for the changes to be reverted.

3 Likes

It has already been rolled back as of when I made this comment: De-Sync Bugs with Instance Replication Fix - #25 by asdfiji123

It was also only ever released on Studio, not on the Server or Client, so it should never have impacted your player base.

If your experience is experiencing bugs, I think it’s probably a different cause :/. If you think it’s an engine issue, please make a separate bug report so we can get the right eyes on it!

1 Like

Hello Developers!

This change is now being re-enabled on Studio! We’ve implemented a fix for the negative interaction with PlayerGui at the beginning of the game, so please let us know if this issue somehow persists, or you see any other problems.

2 Likes

Hi Developers!

We have now rolled out this change globally. If you find that this change causes bugs in your game, please let me know in this thread!

Edit: This has been reverted due to errors when the Character is parent to nil and then back to Workspace in Streaming Enabled games.

2 Likes

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.