perf: scope message equality check to content+parts instead of full object (#842)

This commit is contained in:
Vedant Mahajan
2026-04-12 15:19:34 -07:00
committed by GitHub
parent 1c230b66b4
commit cfd587ed2a
+3 -3
View File
@@ -27,9 +27,9 @@ export function areUIMessageArraysEqual(
return false
}
// Compare the entire message using JSON serialization as a fallback
// This handles all properties including parts, toolInvocations, etc.
if (JSON.stringify(msgA) !== JSON.stringify(msgB)) {
if (msgA.content !== msgB.content) return false
if (JSON.stringify(msgA.parts) !== JSON.stringify(msgB.parts)) {
return false
}
}