mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Catch more sync failures (#845)
- Catch removal failures - Catch name change failures - Don't remove IDs for instances if they weren't actually destroyed
This commit is contained in:
parent
106a01223e
commit
f3b0b0027e
3 changed files with 36 additions and 18 deletions
|
|
@ -25,10 +25,15 @@ local function applyPatch(instanceMap, patch)
|
|||
local unappliedPatch = PatchSet.newEmpty()
|
||||
|
||||
for _, removedIdOrInstance in ipairs(patch.removed) do
|
||||
if Types.RbxId(removedIdOrInstance) then
|
||||
instanceMap:destroyId(removedIdOrInstance)
|
||||
else
|
||||
instanceMap:destroyInstance(removedIdOrInstance)
|
||||
local ok = pcall(function()
|
||||
if Types.RbxId(removedIdOrInstance) then
|
||||
instanceMap:destroyId(removedIdOrInstance)
|
||||
else
|
||||
instanceMap:destroyInstance(removedIdOrInstance)
|
||||
end
|
||||
end)
|
||||
if not ok then
|
||||
table.insert(unappliedPatch.removed, removedIdOrInstance)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -170,7 +175,13 @@ local function applyPatch(instanceMap, patch)
|
|||
end
|
||||
|
||||
if update.changedName ~= nil then
|
||||
instance.Name = update.changedName
|
||||
local ok = pcall(function()
|
||||
instance.Name = update.changedName
|
||||
end)
|
||||
if not ok then
|
||||
unappliedUpdate.changedName = update.changedName
|
||||
partiallyApplied = true
|
||||
end
|
||||
end
|
||||
|
||||
if update.changedMetadata ~= nil then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue