mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Implement live syncback fixes addressing multiple issues
- Added explicit encoding for Workspace attributes and tags in `encodeService.lua` to prevent data loss during syncback. - Filtered non-serializable properties, including `ClockTime`, in `build_dom_from_chunks` to ensure accurate data handling. - Resolved a leak of `Rojo_Ref_CurrentCamera` by filtering deferred referents after camera destruction in `syncback_loop`. - Truncated float values to f32 precision in `UnresolvedValue::from_variant` to match rbxl storage format, improving data consistency. These changes enhance the reliability and accuracy of the live syncback process, addressing critical issues identified in previous implementations.
This commit is contained in:
parent
a75a1443c0
commit
7dc4f52793
6 changed files with 180 additions and 5 deletions
|
|
@ -21,6 +21,9 @@ return function(service: Instance)
|
|||
if SKIP_PROPERTIES[propertyName] then
|
||||
continue
|
||||
end
|
||||
if propertyName == "Attributes" or propertyName == "Tags" then
|
||||
continue
|
||||
end
|
||||
|
||||
local isReadable = propertyMeta.scriptability == "ReadWrite"
|
||||
or propertyMeta.scriptability == "Read"
|
||||
|
|
@ -53,6 +56,32 @@ return function(service: Instance)
|
|||
end
|
||||
end
|
||||
|
||||
local attrOk, attrMap = pcall(function()
|
||||
return service:GetAttributes()
|
||||
end)
|
||||
if attrOk and attrMap and next(attrMap) then
|
||||
local descriptor = RbxDom.findCanonicalPropertyDescriptor(service.ClassName, "Attributes")
|
||||
if descriptor then
|
||||
local encodeOk, encoded = encodeProperty(service, "Attributes", descriptor)
|
||||
if encodeOk and encoded ~= nil then
|
||||
properties.Attributes = encoded
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local tagOk, tagList = pcall(function()
|
||||
return service:GetTags()
|
||||
end)
|
||||
if tagOk and tagList and #tagList > 0 then
|
||||
local descriptor = RbxDom.findCanonicalPropertyDescriptor(service.ClassName, "Tags")
|
||||
if descriptor then
|
||||
local encodeOk, encoded = encodeProperty(service, "Tags", descriptor)
|
||||
if encodeOk and encoded ~= nil then
|
||||
properties.Tags = encoded
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local chunk = {
|
||||
className = service.ClassName,
|
||||
childCount = #service:GetChildren(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue