fix(charm-sync): preserve global patch list order for nil patches

Resolves #67
This commit is contained in:
littensy 2026-09-30 19:20:51 -07:00
parent c31e5c5a34
commit 2fc3be34d0
2 changed files with 24 additions and 3 deletions

View file

@ -125,8 +125,8 @@ local function diffGlobalUpdateBuffer(): { any }
local patchCount = #globalUpdates
local patches = table.create(patchCount)
for _, update in globalUpdates do
table.insert(patches, patch.diff(update.oldValue, update.newValue))
for index, update in globalUpdates do
patches[index] = patch.diff(update.oldValue, update.newValue)
end
return patches
@ -146,7 +146,7 @@ local function selectFromGlobalPatchList(client: any, globalPatches: { any }): {
for index, update in globalUpdates do
local patchData = globalPatches[index]
if not patchData then
if patchData == nil then
continue
end