Description
areMapsEqual compares values via next[key] without verifying key presence. If prev has {a: null} and next has {b: null} (same size, different keys), next[a] returns null, the value comparison passes, and the method incorrectly returns true. This can cause silent diffing errors (e.g., skipping updates when maps actually changed), leading to stale UI/state.
Severity: high
File: litho-core/src/main/java/com/facebook/litho/utils/MapDiffUtils.kt
Expected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.
Description
areMapsEqualcompares values vianext[key]without verifying key presence. Ifprevhas{a: null}andnexthas{b: null}(same size, different keys),next[a]returnsnull, the value comparison passes, and the method incorrectly returnstrue. This can cause silent diffing errors (e.g., skipping updates when maps actually changed), leading to stale UI/state.Severity:
highFile:
litho-core/src/main/java/com/facebook/litho/utils/MapDiffUtils.ktExpected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.