mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-24 06:35:39 +00:00
Fix hydration patch incorrectly comparing properties
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
local RbxDom = require(script.Parent.Parent.RbxDom)
|
local RbxDom = require(script.Parent.Parent.RbxDom)
|
||||||
local t = require(script.Parent.Parent.t)
|
local t = require(script.Parent.Parent.t)
|
||||||
|
local Log = require(script.Parent.Parent.Log)
|
||||||
|
|
||||||
local InstanceMap = require(script.Parent.InstanceMap)
|
local InstanceMap = require(script.Parent.InstanceMap)
|
||||||
local Types = require(script.Parent.Types)
|
local Types = require(script.Parent.Types)
|
||||||
@@ -302,6 +303,7 @@ function Reconciler:__hydrateInternal(apiInstances, id, instance, hydratePatch)
|
|||||||
local decodedValue = self:__decodeApiValue(virtualValue)
|
local decodedValue = self:__decodeApiValue(virtualValue)
|
||||||
|
|
||||||
if existingValue ~= decodedValue then
|
if existingValue ~= decodedValue then
|
||||||
|
Log.warn("Diff! {:?} vs {:?}", existingValue, decodedValue)
|
||||||
changedProperties[propertyName] = virtualValue
|
changedProperties[propertyName] = virtualValue
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ local function getCanonincalProperty(instance, propertyName)
|
|||||||
return false, "unreadable property"
|
return false, "unreadable property"
|
||||||
end
|
end
|
||||||
|
|
||||||
local success, err = descriptor:read(instance)
|
local success, valueOrErr = descriptor:read(instance)
|
||||||
|
|
||||||
if not success then
|
if not success then
|
||||||
|
local err = valueOrErr
|
||||||
|
|
||||||
-- If we don't have permission to read a property, we can chalk that up
|
-- If we don't have permission to read a property, we can chalk that up
|
||||||
-- to our database being out of date and the engine being right.
|
-- to our database being out of date and the engine being right.
|
||||||
if err.kind == RbxDom.Error.Kind.Roblox and err.extra:find("lacking permission") then
|
if err.kind == RbxDom.Error.Kind.Roblox and err.extra:find("lacking permission") then
|
||||||
@@ -31,7 +33,7 @@ local function getCanonincalProperty(instance, propertyName)
|
|||||||
error(message, 2)
|
error(message, 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
return true, valueOrErr
|
||||||
end
|
end
|
||||||
|
|
||||||
return getCanonincalProperty
|
return getCanonincalProperty
|
||||||
Reference in New Issue
Block a user