mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 22:11:38 +00:00
Update logging levels in Rojo plugin and enhance test plans
- Promoted sync-related logging from Debug/Trace to Info level across multiple files, ensuring visibility of changes in the Studio output console. - Added a new plan for expanding the connected mode test suite to cover multi-step scenarios and round-trip identity verification. - Introduced a plan to fix stale tree desynchronization by implementing a validation mechanism on plugin connection. - Created a plan to bump sync logging to Info level, detailing todos for various components in the plugin. This update improves the clarity of logs and enhances testing coverage for connected mode scenarios.
This commit is contained in:
parent
2cc1726975
commit
316d7ea70e
17 changed files with 2443 additions and 1553 deletions
|
|
@ -21,6 +21,7 @@ local Log = require(Packages.Log)
|
|||
local RbxDom = require(Packages.RbxDom)
|
||||
|
||||
local encodeProperty = require(script.Parent.encodeProperty)
|
||||
local UNENCODABLE_DATA_TYPES = require(script.Parent.propertyFilter)
|
||||
|
||||
-- Script class names that need Source property
|
||||
local SCRIPT_CLASS_NAMES = {
|
||||
|
|
@ -234,6 +235,10 @@ encodeInstance = function(instance, parentId, _skipPathCheck)
|
|||
-- Get the full PropertyDescriptor for encoding
|
||||
local descriptor = RbxDom.findCanonicalPropertyDescriptor(instance.ClassName, propertyName)
|
||||
if descriptor then
|
||||
if UNENCODABLE_DATA_TYPES[descriptor.dataType] then
|
||||
continue
|
||||
end
|
||||
|
||||
local encodeSuccess, encodeResult = encodeProperty(instance, propertyName, descriptor)
|
||||
if encodeSuccess and encodeResult ~= nil then
|
||||
properties[propertyName] = encodeResult
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ local Log = require(Packages.Log)
|
|||
local RbxDom = require(Packages.RbxDom)
|
||||
|
||||
local encodeProperty = require(script.Parent.encodeProperty)
|
||||
local UNENCODABLE_DATA_TYPES = require(script.Parent.propertyFilter)
|
||||
|
||||
return function(instance, instanceId, properties)
|
||||
local update = {
|
||||
|
|
@ -21,6 +22,10 @@ return function(instance, instanceId, properties)
|
|||
continue
|
||||
end
|
||||
|
||||
if UNENCODABLE_DATA_TYPES[descriptor.dataType] then
|
||||
continue
|
||||
end
|
||||
|
||||
local encodeSuccess, encodeResult = encodeProperty(instance, propertyName, descriptor)
|
||||
|
||||
if not encodeSuccess then
|
||||
|
|
|
|||
|
|
@ -11,7 +11,13 @@ return function(instance, propertyName, propertyDescriptor)
|
|||
end
|
||||
|
||||
local dataType = propertyDescriptor.dataType
|
||||
local encodeSuccess, encodeResult = RbxDom.EncodedValue.encode(readResult, dataType)
|
||||
local pcallOk, encodeSuccess, encodeResult = pcall(RbxDom.EncodedValue.encode, readResult, dataType)
|
||||
|
||||
if not pcallOk then
|
||||
-- Encoder threw an error (e.g., Ref, Region3, SharedString)
|
||||
Log.warn("Could not sync back property {:?}.{}: {}", instance, propertyName, encodeSuccess)
|
||||
return false, nil
|
||||
end
|
||||
|
||||
if not encodeSuccess then
|
||||
Log.warn("Could not sync back property {:?}.{}: {}", instance, propertyName, encodeResult)
|
||||
|
|
|
|||
|
|
@ -107,12 +107,11 @@ function ChangeBatcher:__flush()
|
|||
return nil
|
||||
end
|
||||
|
||||
-- Log summary at debug level
|
||||
local addedCount = 0
|
||||
for _ in pairs(patch.added) do
|
||||
addedCount += 1
|
||||
end
|
||||
Log.debug("Two-way sync: {} updates, {} additions, {} removals", #patch.updated, addedCount, #patch.removed)
|
||||
Log.info("Two-way sync: {} updates, {} additions, {} removals", #patch.updated, addedCount, #patch.removed)
|
||||
|
||||
return patch
|
||||
end
|
||||
|
|
|
|||
16
plugin/src/ChangeBatcher/propertyFilter.lua
Normal file
16
plugin/src/ChangeBatcher/propertyFilter.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
--[[
|
||||
Property type blacklist for encoding, matching the server-side
|
||||
filter_properties_for_meta behavior in src/web/api.rs.
|
||||
|
||||
Types listed here are skipped during property encoding because they
|
||||
cannot be serialized to JSON or are meaningless for syncback.
|
||||
]]
|
||||
|
||||
-- Property data types that cannot be encoded standalone.
|
||||
-- Matches the Variant::Ref / Variant::UniqueId filter in api.rs.
|
||||
local UNENCODABLE_DATA_TYPES = {
|
||||
Ref = true, -- Instance references; need the InstanceMap, not encodable standalone
|
||||
UniqueId = true, -- Internal Roblox identifiers; not meaningful for syncback
|
||||
}
|
||||
|
||||
return UNENCODABLE_DATA_TYPES
|
||||
Loading…
Add table
Add a link
Reference in a new issue