deps(flutter): Bump sentry-cocoa to 9.17.1 in v10#3764
Conversation
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>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Dependencies
🤖 This preview updates automatically when you update the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
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>
|
@cursor review |
There was a problem hiding this comment.
✅ 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.
There was a problem hiding this comment.
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.1for 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.
…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>
| // 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). |
There was a problem hiding this comment.
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' | |||
There was a problem hiding this comment.
intresting that this was commented out
denrase
left a comment
There was a problem hiding this comment.
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>
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/HybridSDKCocoaPods subspec and moved the hybrid public headers (PrivateSentrySDKOnly.h, the session-replay hybrid headers) into the defaultCoresubspec, so the podspec now depends onSentryinstead ofSentry/HybridSDK. For SwiftPM the equivalentSentry._Hybridsubmodule imports were dropped.Native API migration (cocoa 9):
enableSessionReplayInUnreliableEnvironmentoption (Flutter masks in Dart; cocoa no longer auto-disables replay on iOS 26 Liquid Glass)PrivateSentrySDKOnly.getDebugImages()→debugImageProvider.getDebugImagesFromCache()sentry_formatHexAddressUInt64withString(format: "0x%016llx", ...)SentrySRDefaultBreadcrumbConverter/SentryRRWebBreadcrumbEvent/SentryRRWebSpanEvent(theSentrySessionReplayIntegrationfactory methods were removed)Behavior change — native integrations no longer reported. cocoa 9 removed
SentryOptions.integrationsand exposes no accessor for installed integration names, soloadContextsno longer populatescontexts['integrations']. The Dart side already null-guards this; the integration test was updated to assert their absence, and TODOs inSentryFlutterPlugin.swiftand the test mark this for restoration once cocoa re-exposes the accessor (the cocoa team is adding it).FFI binding:
PrivateSentrySDKOnly.hmoved intoHeaders/, andSentryIdnow generates as a full interface — so theffi-cocoa.yamlentry points were updated and the oldSentryId1/sedworkaround ingenerate-cocoa-bindings.shwas removed.Tooling: on macOS, Flutter derives the SwiftPM package identity from the plugin directory basename (
flutter) rather than the pub name (sentry_flutter), which breaksflutter build macos. Addedscripts/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 renamepackages/flutter, to preserve the monorepo's short-name convention.Also bumps the
min_version_testiOS deployment target to 15. Verified:dart analyzeclean,pod lib lintpasses, 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.