Enhance PatchTree and applyPatch to skip TouchInterest instances during patch processing

- Added logic in PatchTree.build and applyPatch functions to skip instances of ClassName "TouchInterest", which are auto-created by Roblox for touch events.
- This change improves the handling of patch applications by preventing unnecessary processing of these instances.
This commit is contained in:
Joe 2026-01-20 22:17:26 -06:00
parent 4a09689090
commit aa09717545
2 changed files with 11 additions and 0 deletions

View file

@ -335,6 +335,11 @@ function PatchTree.build(patch, instanceMap, changeListHeaders)
continue
end
-- Skip TouchInterest (auto-created by Roblox when touch events are connected)
if instance.ClassName == "TouchInterest" then
continue
end
-- Gather ancestors from existing DOM
-- (note that they may have no ID if they're being removed as unknown)
local ancestryIds = {}

View file

@ -27,6 +27,12 @@ local function applyPatch(instanceMap, patch)
local deferredRefs = {}
for _, removedIdOrInstance in ipairs(patch.removed) do
-- Skip TouchInterest (auto-created by Roblox when touch events are connected)
local instance = if Types.RbxId(removedIdOrInstance) then instanceMap.fromIds[removedIdOrInstance] else removedIdOrInstance
if instance and instance.ClassName == "TouchInterest" then
continue
end
local removeInstanceSuccess = pcall(function()
if Types.RbxId(removedIdOrInstance) then
instanceMap:destroyId(removedIdOrInstance)