mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Update dependencies and improve syncback handling
- Updated versions of several dependencies in `Cargo.lock`, including `async-compression` (0.4.40), `aws-lc-rs` (1.16.0), `bumpalo` (3.20.1), and `compression-codecs` (0.4.37), ensuring compatibility and access to the latest features and fixes. - Refactored the `fire` method in `SyncbackSignal` to return a boolean indicating whether a syncback was successfully initiated, preventing concurrent syncbacks. - Enhanced error handling in the API syncback process to return a conflict response if a syncback is already in progress. - Improved the `serve.rs` file by replacing `forget` with `drop` for better memory management and added checks to ensure service chunk integrity during live syncback operations. - Added new tests for edge cases and resilience in live syncback functionality, ensuring robustness against malformed data and rapid sequential requests. These changes aim to enhance the reliability and performance of the syncback feature while keeping dependencies up to date.
This commit is contained in:
parent
69f0b9fd63
commit
5b38648ead
12 changed files with 387 additions and 117 deletions
|
|
@ -621,7 +621,14 @@ matchChildren = function(
|
|||
if precomputed ~= nil then
|
||||
totalCost += precomputed
|
||||
else
|
||||
totalCost += computePairCost(session, pair.virtualId, pair.studioInstance, virtualInstances, math.huge, depth)
|
||||
totalCost += computePairCost(
|
||||
session,
|
||||
pair.virtualId,
|
||||
pair.studioInstance,
|
||||
virtualInstances,
|
||||
math.huge,
|
||||
depth
|
||||
)
|
||||
end
|
||||
end
|
||||
totalCost += (#unmatchedVirtual + #unmatchedStudio) * UNMATCHED_PENALTY
|
||||
|
|
|
|||
|
|
@ -132,7 +132,13 @@ local function trueEquals(a: any, b: any): boolean
|
|||
return false
|
||||
end
|
||||
for i = 1, #aKp do
|
||||
if not (fuzzyEq(aKp[i].Time, bKp[i].Time) and fuzzyEq(aKp[i].Value, bKp[i].Value) and fuzzyEq(aKp[i].Envelope, bKp[i].Envelope)) then
|
||||
if
|
||||
not (
|
||||
fuzzyEq(aKp[i].Time, bKp[i].Time)
|
||||
and fuzzyEq(aKp[i].Value, bKp[i].Value)
|
||||
and fuzzyEq(aKp[i].Envelope, bKp[i].Envelope)
|
||||
)
|
||||
then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -452,40 +452,54 @@ return function()
|
|||
end)
|
||||
|
||||
it("from Vector2 identical", function()
|
||||
expect(trueEquals(
|
||||
Rect.new(Vector2.new(10, 20), Vector2.new(30, 40)),
|
||||
Rect.new(Vector2.new(10, 20), Vector2.new(30, 40))
|
||||
)).to.equal(true)
|
||||
expect(
|
||||
trueEquals(
|
||||
Rect.new(Vector2.new(10, 20), Vector2.new(30, 40)),
|
||||
Rect.new(Vector2.new(10, 20), Vector2.new(30, 40))
|
||||
)
|
||||
).to.equal(true)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe("NumberSequence", function()
|
||||
it("identical two-keypoint", function()
|
||||
expect(trueEquals(
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1) }),
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1) })
|
||||
)).to.equal(true)
|
||||
expect(
|
||||
trueEquals(
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1) }),
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1) })
|
||||
)
|
||||
).to.equal(true)
|
||||
end)
|
||||
|
||||
it("value within epsilon", function()
|
||||
expect(trueEquals(
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1) }),
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1.00005) })
|
||||
)).to.equal(true)
|
||||
expect(
|
||||
trueEquals(
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1) }),
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1.00005) })
|
||||
)
|
||||
).to.equal(true)
|
||||
end)
|
||||
|
||||
it("value beyond epsilon", function()
|
||||
expect(trueEquals(
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1) }),
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1.002) })
|
||||
)).to.equal(false)
|
||||
expect(
|
||||
trueEquals(
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1) }),
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1.002) })
|
||||
)
|
||||
).to.equal(false)
|
||||
end)
|
||||
|
||||
it("different keypoint count", function()
|
||||
expect(trueEquals(
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1) }),
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(0.5, 0.5), NumberSequenceKeypoint.new(1, 1) })
|
||||
)).to.equal(false)
|
||||
expect(
|
||||
trueEquals(
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1) }),
|
||||
NumberSequence.new({
|
||||
NumberSequenceKeypoint.new(0, 0),
|
||||
NumberSequenceKeypoint.new(0.5, 0.5),
|
||||
NumberSequenceKeypoint.new(1, 1),
|
||||
})
|
||||
)
|
||||
).to.equal(false)
|
||||
end)
|
||||
|
||||
it("simple constructor identical", function()
|
||||
|
|
@ -493,51 +507,99 @@ return function()
|
|||
end)
|
||||
|
||||
it("envelope within epsilon", function()
|
||||
expect(trueEquals(
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 1, 0.5), NumberSequenceKeypoint.new(1, 1, 0.5) }),
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 1, 0.50005), NumberSequenceKeypoint.new(1, 1, 0.5) })
|
||||
)).to.equal(true)
|
||||
expect(
|
||||
trueEquals(
|
||||
NumberSequence.new({ NumberSequenceKeypoint.new(0, 1, 0.5), NumberSequenceKeypoint.new(1, 1, 0.5) }),
|
||||
NumberSequence.new({
|
||||
NumberSequenceKeypoint.new(0, 1, 0.50005),
|
||||
NumberSequenceKeypoint.new(1, 1, 0.5),
|
||||
})
|
||||
)
|
||||
).to.equal(true)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe("ColorSequence", function()
|
||||
it("identical two-keypoint", function()
|
||||
expect(trueEquals(
|
||||
ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.new(1, 0, 0)), ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)) }),
|
||||
ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.new(1, 0, 0)), ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)) })
|
||||
)).to.equal(true)
|
||||
expect(
|
||||
trueEquals(
|
||||
ColorSequence.new({
|
||||
ColorSequenceKeypoint.new(0, Color3.new(1, 0, 0)),
|
||||
ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)),
|
||||
}),
|
||||
ColorSequence.new({
|
||||
ColorSequenceKeypoint.new(0, Color3.new(1, 0, 0)),
|
||||
ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)),
|
||||
})
|
||||
)
|
||||
).to.equal(true)
|
||||
end)
|
||||
|
||||
it("color within epsilon", function()
|
||||
expect(trueEquals(
|
||||
ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.new(0.5, 0, 0)), ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)) }),
|
||||
ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.new(0.50005, 0, 0)), ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)) })
|
||||
)).to.equal(true)
|
||||
expect(
|
||||
trueEquals(
|
||||
ColorSequence.new({
|
||||
ColorSequenceKeypoint.new(0, Color3.new(0.5, 0, 0)),
|
||||
ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)),
|
||||
}),
|
||||
ColorSequence.new({
|
||||
ColorSequenceKeypoint.new(0, Color3.new(0.50005, 0, 0)),
|
||||
ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)),
|
||||
})
|
||||
)
|
||||
).to.equal(true)
|
||||
end)
|
||||
|
||||
it("color beyond epsilon", function()
|
||||
expect(trueEquals(
|
||||
ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.new(0.5, 0, 0)), ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)) }),
|
||||
ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.new(0.6, 0, 0)), ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)) })
|
||||
)).to.equal(false)
|
||||
expect(
|
||||
trueEquals(
|
||||
ColorSequence.new({
|
||||
ColorSequenceKeypoint.new(0, Color3.new(0.5, 0, 0)),
|
||||
ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)),
|
||||
}),
|
||||
ColorSequence.new({
|
||||
ColorSequenceKeypoint.new(0, Color3.new(0.6, 0, 0)),
|
||||
ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)),
|
||||
})
|
||||
)
|
||||
).to.equal(false)
|
||||
end)
|
||||
|
||||
it("different keypoint count", function()
|
||||
expect(trueEquals(
|
||||
ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.new(1, 0, 0)), ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)) }),
|
||||
ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.new(1, 0, 0)), ColorSequenceKeypoint.new(0.5, Color3.new(0, 1, 0)), ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)) })
|
||||
)).to.equal(false)
|
||||
expect(
|
||||
trueEquals(
|
||||
ColorSequence.new({
|
||||
ColorSequenceKeypoint.new(0, Color3.new(1, 0, 0)),
|
||||
ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)),
|
||||
}),
|
||||
ColorSequence.new({
|
||||
ColorSequenceKeypoint.new(0, Color3.new(1, 0, 0)),
|
||||
ColorSequenceKeypoint.new(0.5, Color3.new(0, 1, 0)),
|
||||
ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)),
|
||||
})
|
||||
)
|
||||
).to.equal(false)
|
||||
end)
|
||||
|
||||
it("simple constructor identical", function()
|
||||
expect(trueEquals(ColorSequence.new(Color3.new(1, 0, 0)), ColorSequence.new(Color3.new(1, 0, 0)))).to.equal(true)
|
||||
expect(trueEquals(ColorSequence.new(Color3.new(1, 0, 0)), ColorSequence.new(Color3.new(1, 0, 0)))).to.equal(
|
||||
true
|
||||
)
|
||||
end)
|
||||
|
||||
it("time within epsilon", function()
|
||||
expect(trueEquals(
|
||||
ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.new(1, 0, 0)), ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)) }),
|
||||
ColorSequence.new({ ColorSequenceKeypoint.new(0.00005, Color3.new(1, 0, 0)), ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)) })
|
||||
)).to.equal(true)
|
||||
expect(
|
||||
trueEquals(
|
||||
ColorSequence.new({
|
||||
ColorSequenceKeypoint.new(0, Color3.new(1, 0, 0)),
|
||||
ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)),
|
||||
}),
|
||||
ColorSequence.new({
|
||||
ColorSequenceKeypoint.new(0.00005, Color3.new(1, 0, 0)),
|
||||
ColorSequenceKeypoint.new(1, Color3.new(0, 0, 1)),
|
||||
})
|
||||
)
|
||||
).to.equal(true)
|
||||
end)
|
||||
end)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue