mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-24 06:34:09 +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
|
|
@ -219,7 +219,7 @@ function ServeSession:__onWebSocketMessage(messagesPacket)
|
|||
return
|
||||
end
|
||||
|
||||
Log.debug("Received {} messages from Rojo server", #messagesPacket.messages)
|
||||
Log.info("Received {} messages from Rojo server", #messagesPacket.messages)
|
||||
|
||||
-- Combine all messages into a single patch
|
||||
local combinedPatch = PatchSet.newEmpty()
|
||||
|
|
@ -227,6 +227,17 @@ function ServeSession:__onWebSocketMessage(messagesPacket)
|
|||
PatchSet.assign(combinedPatch, message)
|
||||
end
|
||||
|
||||
local addedCount = 0
|
||||
for _ in pairs(combinedPatch.added) do
|
||||
addedCount += 1
|
||||
end
|
||||
Log.info(
|
||||
"Combined patch: {} removals, {} additions, {} updates",
|
||||
#combinedPatch.removed,
|
||||
addedCount,
|
||||
#combinedPatch.updated
|
||||
)
|
||||
|
||||
-- If we're already waiting for confirmation, merge into the patch being confirmed
|
||||
-- Changes flow into the dialogue even in one-shot mode so user can see them
|
||||
if self.__confirmingPatch ~= nil then
|
||||
|
|
@ -580,7 +591,7 @@ function ServeSession:__applyPatch(patch)
|
|||
end
|
||||
|
||||
if not PatchSet.isEmpty(unappliedPatch) then
|
||||
Log.debug(
|
||||
Log.info(
|
||||
"Could not apply all changes requested by the Rojo server:\n{}",
|
||||
PatchSet.humanSummary(self.__instanceMap, unappliedPatch)
|
||||
)
|
||||
|
|
@ -696,7 +707,7 @@ function ServeSession:__confirmAndApplyInitialPatch(catchUpPatch, serverInfo)
|
|||
ignoreCount += 1
|
||||
end
|
||||
end
|
||||
Log.debug("User selections: {} push, {} pull, {} ignored", pushCount, pullCount, ignoreCount)
|
||||
Log.info("User selections: {} push, {} pull, {} ignored", pushCount, pullCount, ignoreCount)
|
||||
|
||||
-- Build partial patches based on selections
|
||||
local pushPatch = PatchSet.newEmpty() -- Items to apply to Studio
|
||||
|
|
@ -710,9 +721,9 @@ function ServeSession:__confirmAndApplyInitialPatch(catchUpPatch, serverInfo)
|
|||
|
||||
if selection == "push" then
|
||||
-- Apply Rojo changes to Studio
|
||||
Log.trace("[Push] Update: {}", instancePath)
|
||||
table.insert(pushPatch.updated, change)
|
||||
elseif selection == "pull" and self.__twoWaySync then
|
||||
Log.info("[Push] Update: {}", instancePath)
|
||||
table.insert(pushPatch.updated, change)
|
||||
elseif selection == "pull" and self.__twoWaySync then
|
||||
-- Send Studio state back to Rojo
|
||||
if instance then
|
||||
local propertiesToSync = change.changedProperties
|
||||
|
|
@ -723,7 +734,7 @@ function ServeSession:__confirmAndApplyInitialPatch(catchUpPatch, serverInfo)
|
|||
continue
|
||||
end
|
||||
end
|
||||
Log.trace("[Pull] Update: {}", instancePath)
|
||||
Log.info("[Pull] Update: {}", instancePath)
|
||||
local update = encodePatchUpdate(instance, change.id, propertiesToSync)
|
||||
if update then
|
||||
table.insert(pullPatch.updated, update)
|
||||
|
|
@ -754,7 +765,7 @@ function ServeSession:__confirmAndApplyInitialPatch(catchUpPatch, serverInfo)
|
|||
|
||||
if selection == "push" then
|
||||
-- Apply Rojo removal to Studio (delete the instance)
|
||||
Log.trace("[Push] Delete: {}", instancePath)
|
||||
Log.info("[Push] Delete: {}", instancePath)
|
||||
table.insert(pushPatch.removed, idOrInstance)
|
||||
elseif selection == "pull" and self.__twoWaySync then
|
||||
-- Syncback: Create file in Rojo from Studio instance
|
||||
|
|
@ -789,7 +800,7 @@ function ServeSession:__confirmAndApplyInitialPatch(catchUpPatch, serverInfo)
|
|||
|
||||
if selection == "push" then
|
||||
-- Apply Rojo addition to Studio
|
||||
Log.trace("[Push] Add: {}.{}", parentPath, instanceName)
|
||||
Log.info("[Push] Add: {}.{}", parentPath, instanceName)
|
||||
pushPatch.added[id] = change
|
||||
elseif selection == "pull" and self.__twoWaySync then
|
||||
-- Don't add in Studio, remove from Rojo
|
||||
|
|
@ -810,12 +821,12 @@ function ServeSession:__confirmAndApplyInitialPatch(catchUpPatch, serverInfo)
|
|||
for _ in pairs(pushPatch.added) do
|
||||
addCount += 1
|
||||
end
|
||||
Log.debug(
|
||||
"Applying to Studio: {} additions, {} removals, {} updates",
|
||||
addCount,
|
||||
#pushPatch.removed,
|
||||
#pushPatch.updated
|
||||
)
|
||||
Log.info(
|
||||
"Applying to Studio: {} additions, {} removals, {} updates",
|
||||
addCount,
|
||||
#pushPatch.removed,
|
||||
#pushPatch.updated
|
||||
)
|
||||
self:__applyPatch(pushPatch)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue