You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Snapshot summary totals appear to be calculated incorrectly when previous totals don't exist #2576
When calculating totals, we initialize the previous as 0 if not set. Given these summaries are optional, we may incorrectly calculate the totals where files exist but don't have total summaries set.
let previous_total = previous_summary.map_or(0, |previous_summary| {
previous_summary
.additional_properties
.get(total_property)
.map_or(0, |value| value.parse::<u64>().unwrap())
});
To Reproduce
No response
Expected behavior
I expect that we should skip calculating the totals when we do not have a previous value to reference. This does mean some other process would need to calculate the totals outside of this commit in order to introduce totals to the snapshot summaries.
Activity
dannycjones commentedon Jun 3, 2026
@CTTY does this sound like a real bug? I am happy to make this change if so (and I'd like to include in #2527).
fix(spec): Fix incorrect totals when previous is omitted or invalid (a…