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

This commit is contained in:
Vedant Mahajan 2026-04-13 03:49:34 +05:30 committed by GitHub
parent 1c230b66b4
commit cfd587ed2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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
}
}