Skip to content

fix: cancel pending KSCrash report processing - #8589

Draft
supervacuus wants to merge 1 commit into
supervacuus/feat/kscrash-report-sinkfrom
fix/cancel-pending-kscrash-processing
Draft

fix: cancel pending KSCrash report processing#8589
supervacuus wants to merge 1 commit into
supervacuus/feat/kscrash-report-sinkfrom
fix/cancel-pending-kscrash-processing

Conversation

@supervacuus

@supervacuus supervacuus commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

#skip-changelog (for V10)

📜 Description

Fixes #8535 on top of #8515.

This adds a generation-scoped report-processing session that is canceled upon SentryKSCrash.Integration uninstallation.

Queued or pre-capture work completes with a retryable error, while work that has committed to client capture finishes normally. Canceled drains also stop before processing another report or running end-of-drain cleanup.

Rergarding review and merge process:

💡 Motivation and Context

Pending KSCrash report processing currently outlives its integration. After SentrySDK.close(), stale work can continue without a client or be captured upon a later SDK start.

The processing session provides nonblocking cancellation, exactly-once filter completion, and isolation between SDK generations.

💚 How did you test it?

Added deterministic tests covering:

  • queued and in-progress cancellation
  • cancellation racing completion
  • the capture commit boundary
  • hub replacement and SDK restart isolation
  • sender iteration and cleanup cancellation
  • distinct sessions across integration restarts

Also ran the KSCrash-enabled iOS and macOS test suites locally.

I will follow up with a real on-disk retry and cleanup across launches testing in #8593 (tracking issue: #8539).

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • If I added a new public API, I also added it to the SentryObjC wrapper.

@supervacuus supervacuus self-assigned this Jul 29, 2026
@supervacuus supervacuus added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Jul 29, 2026
@sentry

sentry Bot commented Jul 29, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

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

⚙️ sentry-cocoa Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1212.83 ms 1251.37 ms 38.54 ms
Size 24.14 KiB 1.24 MiB 1.22 MiB

Baseline results on branch: supervacuus/feat/kscrash-report-sink

Startup times

Revision Plain With Sentry Diff
8576fa5 1215.66 ms 1256.45 ms 40.79 ms
ea690ac 1217.16 ms 1261.51 ms 44.35 ms
ffce4be 1241.52 ms 1269.87 ms 28.35 ms
941ad74 1214.30 ms 1247.06 ms 32.76 ms
053e1df 1242.04 ms 1276.19 ms 34.15 ms
edd3780 1226.46 ms 1260.02 ms 33.57 ms
700456f 1225.04 ms 1259.40 ms 34.36 ms
68e2865 1213.20 ms 1251.37 ms 38.16 ms
718b8fd 1221.45 ms 1241.13 ms 19.68 ms

App size

Revision Plain With Sentry Diff
8576fa5 24.14 KiB 1.24 MiB 1.22 MiB
ea690ac 24.14 KiB 1.24 MiB 1.22 MiB
ffce4be 24.14 KiB 1.24 MiB 1.22 MiB
941ad74 24.14 KiB 1.25 MiB 1.22 MiB
053e1df 24.14 KiB 1.24 MiB 1.22 MiB
edd3780 24.14 KiB 1.24 MiB 1.22 MiB
700456f 24.14 KiB 1.24 MiB 1.21 MiB
68e2865 24.14 KiB 1.24 MiB 1.22 MiB
718b8fd 24.14 KiB 1.24 MiB 1.22 MiB

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

Labels

run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant