De-Sync Bugs with Instance Replication Fix

Yes, that is what will happen with this new behavior

2 Likes

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?

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

3 Likes

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

1 Like

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

1 Like

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?

1 Like

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.

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

1 Like

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

1 Like

GuiBug.rbxl (34.6 KB)

2 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…

1 Like

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.

1 Like

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

1 Like

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

1 Like

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!

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

1 Like

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.

1 Like

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.

1 Like