Skip to content

deps(flutter): Bump sentry-cocoa to 9.17.1 in v10#3764

Merged
buenaflor merged 5 commits into
v10-branchfrom
feat/bump-sentry-cocoa-v9
Jun 22, 2026
Merged

deps(flutter): Bump sentry-cocoa to 9.17.1 in v10#3764
buenaflor merged 5 commits into
v10-branchfrom
feat/bump-sentry-cocoa-v9

Conversation

@buenaflor

@buenaflor buenaflor commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Bumps the embedded sentry-cocoa SDK from 8.58.3 to the latest 9.x for the v10 line. The major bump raises the minimum supported platforms to iOS 15 / macOS 12 (cocoa 9's floor) and removes or renames several native APIs the Flutter SDK relied on, so this migrates the Swift/ObjC layer and regenerates the FFI binding.

Dependency / packaging: cocoa 9 removed the Sentry/HybridSDK CocoaPods subspec and moved the hybrid public headers (PrivateSentrySDKOnly.h, the session-replay hybrid headers) into the default Core subspec, so the podspec now depends on Sentry instead of Sentry/HybridSDK. For SwiftPM the equivalent Sentry._Hybrid submodule imports were dropped.

Native API migration (cocoa 9):

  • Drop the removed enableSessionReplayInUnreliableEnvironment option (Flutter masks in Dart; cocoa no longer auto-disables replay on iOS 26 Liquid Glass)
  • Replace PrivateSentrySDKOnly.getDebugImages()debugImageProvider.getDebugImagesFromCache()
  • Replace the removed sentry_formatHexAddressUInt64 with String(format: "0x%016llx", ...)
  • Build replay events via SentrySRDefaultBreadcrumbConverter / SentryRRWebBreadcrumbEvent / SentryRRWebSpanEvent (the SentrySessionReplayIntegration factory methods were removed)

Behavior change — native integrations no longer reported. cocoa 9 removed SentryOptions.integrations and exposes no accessor for installed integration names, so loadContexts no longer populates contexts['integrations']. The Dart side already null-guards this; the integration test was updated to assert their absence, and TODOs in SentryFlutterPlugin.swift and the test mark this for restoration once cocoa re-exposes the accessor (the cocoa team is adding it).

FFI binding: PrivateSentrySDKOnly.h moved into Headers/, and SentryId now generates as a full interface — so the ffi-cocoa.yaml entry points were updated and the old SentryId1/sed workaround in generate-cocoa-bindings.sh was removed.

Tooling: on macOS, Flutter derives the SwiftPM package identity from the plugin directory basename (flutter) rather than the pub name (sentry_flutter), which breaks flutter build macos. Added scripts/build-macos-example.sh (+ melos run build:macos-example) that temporarily renames the package and restores it, plus a CONTRIBUTING note. We deliberately did not rename packages/flutter, to preserve the monorepo's short-name convention.

Also bumps the min_version_test iOS deployment target to 15. Verified: dart analyze clean, pod lib lint passes, and both the iOS (simulator) and macOS example builds succeed against cocoa 9.17.1.

BREAKING CHANGE: minimum supported versions are now iOS 15 and macOS 12.

Bump the embedded sentry-cocoa SDK from 8.58.3 to the latest 9.x.

Raise the minimum deployment targets to iOS 15 and macOS 12, as required
by sentry-cocoa 9. Migrate native code to the cocoa 9 API surface:

- Drop the removed `enableSessionReplayInUnreliableEnvironment` option
- Drop the removed `PrivateSentrySDKOnly.options.integrations` accessor
- Replace `PrivateSentrySDKOnly.getDebugImages()` with
  `debugImageProvider.getDebugImagesFromCache()`
- Format image addresses in Swift instead of the removed
  `sentry_formatHexAddressUInt64`
- Drop the obsolete `Sentry._Hybrid` submodule imports
- Build replay events via `SentrySRDefaultBreadcrumbConverter`,
  `SentryRRWebBreadcrumbEvent`, and `SentryRRWebSpanEvent`

Regenerate the FFI binding: PrivateSentrySDKOnly.h moved into Headers/ and
SentryId is now generated as a full interface, so the SentryId1/sed
workaround is removed.

Add scripts/build-macos-example.sh (and a melos build:macos-example alias)
to build the macOS example, working around Flutter deriving the SwiftPM
package identity from the plugin directory basename.

BREAKING CHANGE: minimum supported versions are now iOS 15 and macOS 12.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Dependencies

  • (flutter) Bump sentry-cocoa to 9.17.1 in v10 by buenaflor in #3764

🤖 This preview updates automatically when you update the PR.

@buenaflor buenaflor changed the title feat(flutter)!: Bump sentry-cocoa to 9.17.1 feat(flutter): Bump sentry-cocoa to 9.17.1 in v10 Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.59%. Comparing base (0f21c15) to head (b550b7f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@              Coverage Diff               @@
##           v10-branch    #3764      +/-   ##
==============================================
+ Coverage       87.08%   91.59%   +4.50%     
==============================================
  Files             336      105     -231     
  Lines           12059     3758    -8301     
==============================================
- Hits            10502     3442    -7060     
+ Misses           1557      316    -1241     
Flag Coverage Δ
sentry ?
sentry_dio ?
sentry_drift ?
sentry_file ?
sentry_firebase_remote_config 100.00% <ø> (ø)
sentry_flutter 91.18% <ø> (-0.37%) ⬇️
sentry_hive ?
sentry_isar ?
sentry_link ?
sentry_logging ?
sentry_sqflite ?
sentry_supabase 97.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

buenaflor and others added 2 commits June 15, 2026 13:04
sentry-cocoa 9 removed the Sentry/HybridSDK CocoaPods subspec; the hybrid
public headers now ship with the default Core subspec. Depend on `Sentry`
instead so pod resolution and pod-lint succeed, and update update-cocoa.sh to
match.

Bump the min_version_test iOS deployment target to 15 (cocoa 9's floor).

Update the loadContexts integration test: cocoa 9 exposes no accessor for
installed integration names, so native integrations are no longer reported.
Assert their absence and leave a TODO to restore once cocoa adds the accessor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The swift-lint CI job runs with --strict, which promotes the default todo
rule to an error. Keep the tracked TODO about restoring native integration
reporting and suppress just that line with swiftlint:disable:next todo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@buenaflor

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 80f6e1d. Configure here.

@buenaflor buenaflor changed the title feat(flutter): Bump sentry-cocoa to 9.17.1 in v10 deps(flutter): Bump sentry-cocoa to 9.17.1 in v10 Jun 15, 2026
@buenaflor buenaflor marked this pull request as ready for review June 15, 2026 20:43
@buenaflor buenaflor requested a review from denrase as a code owner June 15, 2026 20:43
Copilot AI review requested due to automatic review settings June 15, 2026 20:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the Flutter SDK’s embedded sentry-cocoa dependency to 9.17.1 for the v10 line, migrating the iOS/macOS native bridge code, updating deployment targets to meet cocoa 9’s minimums (iOS 15 / macOS 12), and regenerating the Cocoa FFI bindings. It also adds tooling/docs to work around a macOS SwiftPM package-identity issue when building the Flutter example.

Changes:

  • Bump sentry-cocoa to 9.17.1 for both CocoaPods and SwiftPM, and migrate removed/renamed native APIs (profiling, debug images, replay event building).
  • Raise iOS/macOS deployment targets across the plugin, examples, and min-version test projects to align with cocoa 9.
  • Update FFI generation inputs (header locations / SentryId exposure) and add a macOS example build helper script + melos alias + CONTRIBUTING docs.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/build-macos-example.sh Adds a helper to rename packages/flutter during macOS example builds to satisfy SwiftPM identity expectations.
packages/flutter/scripts/update-cocoa.sh Updates the podspec version regex to match the new Sentry dependency name.
packages/flutter/scripts/generate-cocoa-bindings.sh Removes the previous post-ffigen sed workaround for SentryId typing.
packages/flutter/lib/src/native/cocoa/sentry_native_cocoa.dart Switches to the newly-generated SentryId API in the Cocoa binding.
packages/flutter/ios/sentry_flutter/Sources/sentry_flutter/SentryFlutterPlugin.swift Migrates removed cocoa APIs (integrations enumeration, debug images, hex formatting) and updates session replay plumbing.
packages/flutter/ios/sentry_flutter/Sources/sentry_flutter/SentryFlutter.swift Drops removed cocoa option enableSessionReplayInUnreliableEnvironment.
packages/flutter/ios/sentry_flutter/Sources/sentry_flutter_objc/SentryFlutterReplayScreenshotProvider.m Removes SwiftPM-only hybrid module import.
packages/flutter/ios/sentry_flutter/Sources/sentry_flutter_objc/SentryFlutterReplayBreadcrumbConverter.m Updates replay breadcrumb/span event creation to cocoa 9 types.
packages/flutter/ios/sentry_flutter/Package.swift Raises platforms (iOS/macOS) and bumps SwiftPM sentry-cocoa dependency to 9.17.1.
packages/flutter/ios/sentry_flutter.podspec Switches dependency to Sentry and raises iOS/macOS deployment targets to 15/12.
packages/flutter/ffi-cocoa.yaml Updates header entry points (moved PrivateSentrySDKOnly.h) and adds SentryId.h for ffigen.
packages/flutter/example/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved Updates resolved sentry-cocoa version/revision for macOS example workspace.
packages/flutter/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved Updates resolved sentry-cocoa version/revision for macOS example project workspace.
packages/flutter/example/macos/Runner.xcodeproj/project.pbxproj Raises macOS deployment target to 12.0 for the macOS example.
packages/flutter/example/macos/Podfile Raises macOS platform/deployment target to 12.0 for CocoaPods builds.
packages/flutter/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved Updates resolved sentry-cocoa version/revision for iOS example workspace.
packages/flutter/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved Updates resolved sentry-cocoa version/revision for iOS example project workspace.
packages/flutter/example/ios/Runner.xcodeproj/project.pbxproj Raises iOS deployment target to 15.0 for the iOS example.
packages/flutter/example/ios/Podfile Raises iOS platform/deployment target to 15.0 for CocoaPods builds.
packages/flutter/example/integration_test/integration_test.dart Updates the integration test to assert native integrations are no longer reported (cocoa 9 API removal).
min_version_test/ios/Runner.xcodeproj/project.pbxproj Raises iOS deployment target to 15.0 for the min-version test app.
min_version_test/ios/Podfile Raises iOS platform/deployment target to 15.0 for the min-version test app’s pods.
melos.yaml Adds a build:macos-example script alias for the new macOS example build helper.
CONTRIBUTING.md Documents the macOS SwiftPM identity issue and the recommended build workaround script.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/build-macos-example.sh
Comment thread packages/flutter/ios/sentry_flutter.podspec
…rgets

Add preflight checks to build-macos-example.sh so it refuses to run when
packages/sentry_flutter already exists (the rename would otherwise nest the
directory and the restore trap would corrupt the tree) or when
packages/flutter is missing. Install the EXIT trap only after the rename
succeeds.

Bump the microbenchmarks iOS and macOS deployment targets to 15.0 / 12.0 to
match the cocoa 9 minimums now required by the sentry_flutter podspec, keeping
them consistent with the example app.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment on lines +217 to +222
// swiftlint:disable:next todo
// TODO(cocoa): sentry-cocoa 9 removed `SentryOptions.integrations` and
// exposes no accessor for installed integration names, so we no longer
// report `infos["integrations"]`. Restore this (filtering out
// SentrySessionReplayIntegration) once cocoa exposes the installed
// integration names again (the cocoa team is adding the accessor).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll create an issue for this as well for tracking

@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

intresting that this was commented out

@denrase denrase left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should also update the patter in update-cocoa.sh to only use v9:

 pattern: '^8\.'

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@buenaflor buenaflor merged commit aa11320 into v10-branch Jun 22, 2026
58 of 59 checks passed
@buenaflor buenaflor deleted the feat/bump-sentry-cocoa-v9 branch June 22, 2026 11:42
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.

3 participants