Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Unreleased

### Dependencies

- Bump Cocoa SDK from v8.55.1 to v8.57.1 ([#474](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/474))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8571)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.55.1...8.57.1)

## 0.20.0

### Dependencies
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ object Config {
val sentryAndroid = "io.sentry:sentry-android:$sentryJavaVersion"
val sentryJava = "io.sentry:sentry:$sentryJavaVersion"

val sentryCocoaVersion = "8.55.1"
val sentryCocoaVersion = "8.57.1"
val sentryCocoa = "Sentry"

object Samples {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ id=io.sentry.kotlin.multiplatform.gradle
implementationClass=io.sentry.kotlin.multiplatform.gradle.SentryPlugin
versionName=0.20.0
group=io.sentry
sentryCocoaVersion=8.55.1
sentryCocoaVersion=8.57.1

# publication pom properties
POM_NAME=Sentry Kotlin Multiplatform Gradle Plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Pod::Spec.new do |spec|
spec.osx.deployment_target = '10.13'
spec.tvos.deployment_target = '11.0'
spec.watchos.deployment_target = '4.0'
spec.dependency 'Sentry', '8.55.1'
spec.dependency 'Sentry', '8.57.1'

if !Dir.exist?('build/cocoapods/framework/sentry_kotlin_multiplatform.framework') || Dir.empty?('build/cocoapods/framework/sentry_kotlin_multiplatform.framework')
raise "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ import platform.Foundation.NSNumber

private typealias InternalSentryEvent = Internal.Sentry.SentryEvent
private typealias InternalSentrySDK = Internal.Sentry.SentrySDKInternal
private typealias InternalSentryEnvelope = Internal.Sentry.SentryEnvelope
private typealias InternalSentryDependencyContainer = Internal.Sentry.SentryDependencyContainer
private typealias InternalSentryEnvelopeHeader = Internal.Sentry.SentryEnvelopeHeader
private typealias InternalSentryEnvelopeItem = Internal.Sentry.SentryEnvelopeItem
private typealias InternalSentryThreadInspector = Internal.Sentry.SentryThreadInspector

private typealias CocoapodsSentryEvent = cocoapods.Sentry.SentryEvent
Expand All @@ -33,6 +30,9 @@ private typealias CocoapodsSentryStacktrace = cocoapods.Sentry.SentryStacktrace
private typealias CocoapodsSentryException = cocoapods.Sentry.SentryException
private typealias CocoapodsSentryMechanism = cocoapods.Sentry.SentryMechanism
private typealias CocoapodsSentryThread = cocoapods.Sentry.SentryThread
private typealias CocoapodsSentryEnvelope = cocoapods.Sentry.SentryEnvelope
private typealias CocoapodsSentryEnvelopeHeader = cocoapods.Sentry.SentryEnvelopeHeader
private typealias CocoapodsSentryEnvelopeItem = cocoapods.Sentry.SentryEnvelopeItem

/**
* Drops the Kotlin crash that follows an unhandled Kotlin exception except our custom SentryEvent.
Expand All @@ -57,7 +57,7 @@ public fun setSentryUnhandledExceptionHook(): Unit = wrapUnhandledExceptionHook
val envelope = throwable.asSentryEnvelope()
// The envelope will be persisted, so we can safely terminate afterwards.
// https://github.com/getsentry/sentry-cocoa/blob/678172142ac1d10f5ed7978f69d16ab03e801057/Sources/Sentry/SentryClient.m#L409
InternalSentrySDK.storeEnvelope(envelope)
InternalSentrySDK.storeEnvelope(envelope as objcnames.classes.SentryEnvelope)
CocoapodsSentrySDK.configureScope { scope ->
scope?.setTagValue(KOTLIN_CRASH_TAG, KOTLIN_CRASH_TAG)
}
Expand All @@ -71,20 +71,20 @@ internal const val KOTLIN_CRASH_TAG = "nsexceptionkt.kotlin_crashed"
/**
* Converts `this` [Throwable] to a [SentryEnvelope].
*/
internal fun Throwable.asSentryEnvelope(): InternalSentryEnvelope {
private fun Throwable.asSentryEnvelope(): CocoapodsSentryEnvelope {
val event = asSentryEvent() as InternalSentryEvent
val preparedEvent = InternalSentrySDK.currentHub().let { hub ->
hub.getClient()
?.prepareEvent(event, hub.scope, alwaysAttachStacktrace = false, isFatalEvent = true)
} ?: event
val item = InternalSentryEnvelopeItem(preparedEvent)
val item = CocoapodsSentryEnvelopeItem(event = preparedEvent as cocoapods.Sentry.SentryEvent)
// TODO: pass traceState when enabling performance monitoring for KMP SDK
val header = InternalSentryEnvelopeHeader(preparedEvent.eventId, null)
return InternalSentryEnvelope(header, listOf(item))
val header = CocoapodsSentryEnvelopeHeader(id = preparedEvent.eventId)
return CocoapodsSentryEnvelope(header, listOf(item))
}

/**
* Converts `this` [Throwable] to a [SentryEvent].
* Converts `this` [Throwable] to a [cocoapods.Sentry.SentryEvent].
*/
@Suppress("UnnecessaryOptInAnnotation")
private fun Throwable.asSentryEvent(): CocoapodsSentryEvent =
Expand All @@ -110,7 +110,7 @@ private fun Throwable.asSentryEvent(): CocoapodsSentryEvent =
}

/**
* Converts `this` [NSException] to a [SentryException].
* Converts `this` [NSException] to a [io.sentry.kotlin.multiplatform.protocol.SentryException].
*/
private fun NSException.asSentryException(
threadId: NSNumber?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language = Objective-C
headers = SentryClient.h SentryDebugImageProvider.h SentryEnvelope.h \ SentryHub.h SentryScope.h \
headers = SentryClient.h SentryEvent.h SentryDebugImageProvider.h SentryHub.h SentryScope.h \
SentryCrashMonitor_NSException.h SentryCrashMonitor_NSException+NSExceptionKt.h \
SentryCrashStackCursor.h SentryDependencyContainer.h SentryHook.h SentrySDKInternal.h \
SentryStacktraceBuilder.h SentryThreadInspector.h PrivateSentrySDKOnly.h \

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,4 @@

@property (nonatomic, assign) BOOL isFatalEvent;

@property (nonatomic, strong) SentryId *eventId;

Comment on lines -27 to -28
Copy link
Contributor

Choose a reason for hiding this comment

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

removed this since we don't need it anymore

@end
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

#import <SentryEnvelope.h>
@class SentryEnvelope;

#import <SentryHub.h>

@interface SentrySDKInternal : NSObject
Expand Down
12 changes: 6 additions & 6 deletions sentry-samples/kmp-app-cocoapods/iosApp/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PODS:
- Sentry (8.55.1):
- Sentry/Core (= 8.55.1)
- Sentry/Core (8.55.1)
- Sentry (8.57.1):
- Sentry/Core (= 8.57.1)
- Sentry/Core (8.57.1)
- shared (1.0):
- Sentry (= 8.55.1)
- Sentry (= 8.57.1)

DEPENDENCIES:
- shared (from `../shared`)
Expand All @@ -17,8 +17,8 @@ EXTERNAL SOURCES:
:path: "../shared"

SPEC CHECKSUMS:
Sentry: 6c92b12db0634612f6a66757890fea97e788fe12
shared: 889fbc0d727dc0533f7fc04bee9d2d0418190291
Sentry: ea4ca7cd1a46c77dcc8123804ce36d8f5603a841
shared: 84e27d3ad161d8351fdb4f11eecf42fec2623cf8

PODFILE CHECKSUM: f282da88f39e69507b0a255187c8a6b644477756

Expand Down
2 changes: 1 addition & 1 deletion sentry-samples/kmp-app-cocoapods/shared/shared.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Pod::Spec.new do |spec|
spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework'
spec.libraries = 'c++'
spec.ios.deployment_target = '14.1'
spec.dependency 'Sentry', '8.55.1'
spec.dependency 'Sentry', '8.57.1'

if !Dir.exist?('build/cocoapods/framework/shared.framework') || Dir.empty?('build/cocoapods/framework/shared.framework')
raise "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
repositoryURL = "https://github.com/getsentry/sentry-cocoa.git";
requirement = {
kind = exactVersion;
version = 8.55.1;
version = 8.57.1;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading