Skip to content

fix: accumulate client report drops by quantity#8230

Merged
philipphofmann merged 4 commits into
mainfrom
fix/client-report-quantity-accumulation
Jun 29, 2026
Merged

fix: accumulate client report drops by quantity#8230
philipphofmann merged 4 commits into
mainfrom
fix/client-report-quantity-accumulation

Conversation

@philipphofmann

@philipphofmann philipphofmann commented Jun 26, 2026

Copy link
Copy Markdown
Member

Fixes the client report discarded-event accumulator.

When a (category, reason) entry already existed, recordLostEvent:reason:quantity: set quantity = event.quantity + 1, ignoring the passed quantity. Correct for the quantity:1 overload, but undercounts categories reported in quantities >1 (e.g. spans via recordLostSpans:). Now adds the dropped quantity.

Matches sentry-python (self._discarded_events[...] += quantity).

I discovered this while reviewing #8186

Closes #8231

recordLostEvent only added 1 per drop when an entry already existed,
undercounting categories reported in quantities >1 (e.g. spans). Add
the dropped quantity instead. Matches sentry-python.
@philipphofmann philipphofmann added the ready-to-merge Use this label to trigger all PR workflows label Jun 26, 2026
@philipphofmann
philipphofmann marked this pull request as ready for review June 26, 2026 10:39
@sentry

sentry Bot commented Jun 26, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.19.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1224.96 ms 1243.63 ms 18.67 ms
Size 24.14 KiB 1.22 MiB 1.20 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c67ced3 1223.22 ms 1256.15 ms 32.93 ms
e42f000 1218.08 ms 1257.49 ms 39.41 ms
dde298d 1212.13 ms 1247.89 ms 35.76 ms
c3ca123 1220.65 ms 1251.83 ms 31.18 ms
4c437ea 1241.63 ms 1266.20 ms 24.57 ms
bf10fe6 1226.00 ms 1260.76 ms 34.76 ms
2446b3d 1218.36 ms 1253.98 ms 35.62 ms
09627e8 1223.68 ms 1261.95 ms 38.27 ms
e3147fd 1227.15 ms 1257.79 ms 30.63 ms
44b7b59 1211.91 ms 1248.90 ms 36.99 ms

App size

Revision Plain With Sentry Diff
c67ced3 24.14 KiB 1.16 MiB 1.13 MiB
e42f000 24.14 KiB 1.17 MiB 1.15 MiB
dde298d 24.14 KiB 1.22 MiB 1.20 MiB
c3ca123 24.14 KiB 1.17 MiB 1.14 MiB
4c437ea 24.14 KiB 1.18 MiB 1.15 MiB
bf10fe6 24.14 KiB 1.17 MiB 1.15 MiB
2446b3d 24.14 KiB 1.17 MiB 1.15 MiB
09627e8 24.14 KiB 1.17 MiB 1.14 MiB
e3147fd 24.14 KiB 1.17 MiB 1.14 MiB
44b7b59 24.14 KiB 1.15 MiB 1.13 MiB

Previous results on branch: fix/client-report-quantity-accumulation

Startup times

Revision Plain With Sentry Diff
1c9c8fd 1211.46 ms 1253.11 ms 41.66 ms

App size

Revision Plain With Sentry Diff
1c9c8fd 24.14 KiB 1.22 MiB 1.20 MiB

@philipphofmann
philipphofmann enabled auto-merge (squash) June 29, 2026 08:37

@philprime philprime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice catch, LGTM

@philipphofmann
philipphofmann merged commit 222091d into main Jun 29, 2026
281 checks passed
@philipphofmann
philipphofmann deleted the fix/client-report-quantity-accumulation branch June 29, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: accumulate client report drops by quantity

3 participants