Skip to content

Comm ClientRemoteProperty initial observe race #238

@Azuuu

Description

@Azuuu

Had a weird race execution of the observer. If the property is ready the Changed Event is called first before the initial deferred callback.
When the server called Set() on the property, Client receives the changed event but then since calling the ClientRemoteProperty:Observe() defers the current value. It overrides the change resulting to going back to the old value.

function ClientRemoteProperty:Observe(observer: (any) -> ())
	if self._ready then
		--task.defer(observer, self._value)
		task.spawn(observer, self._value)
	end
	return self.Changed:Connect(observer)
end

Note

I am not sure changing this to spawn to call it immediately fixes the whole thing. But doing this on my project fixes my issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions