Skip to content

Conversation

@bitsandfoxes
Copy link
Contributor

@bitsandfoxes bitsandfoxes commented Nov 11, 2025

Resolves #65
Relates to #2408

#skip-changelog

@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 85b3a6f

$item = Get-Item $Path
if ($item.PSIsContainer) {
# Directory - sum all files
$size = (Get-ChildItem -Path $Path -Recurse -File | Measure-Object -Property Length -Sum).Sum
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Empty Data Yields Null Sums

When a directory contains no files, Measure-Object -Property Length -Sum returns an object where .Sum is $null rather than 0. This $null value propagates through arithmetic operations and formatting functions, potentially causing incorrect calculations or type errors in the build size comparison and summary generation.

Fix in Cursor Fix in Web

$percentChange = if ($size1 -gt 0) { ($diff / $size1) * 100 } else { 0 }

$diffFormatted = "$(if ($diff -gt 0) { '+' })$(Format-Size ([Math]::Abs($diff)))"
$percentFormatted = "$(if ($diff -gt 0) { '+' })$([Math]::Round($percentChange, 2))%"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Negative Values: Sign Missing, Clarity Lost

The formatted difference and percentage strings only add a + sign for positive values but omit the - sign for negative values. When the build with Sentry is smaller than without Sentry (negative difference), the console output shows the size/percentage without any sign, making it unclear whether the size increased or decreased.

Fix in Cursor Fix in Web

uses: actions/cache@v4
with:
path: samples/IntegrationTest/Build-NoSentry
key: build-nosentry-${{ matrix.build_platform }}-${{ matrix.unity-version }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Stale Cache Distorts Build Size Metrics

The cache key for Build-NoSentry only includes platform and Unity version, not the source code state. When code changes between workflow runs on the same branch, the cache returns a stale build from old code, while Build is freshly built from new code. This causes size comparisons to measure both Sentry's impact and unrelated code changes, producing incorrect metrics. The same issue exists in the Android (line 52-57), iOS (line 58-63), and Windows (line 412-417) workflows.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundle size needs to be part of CI

2 participants