Skip to content

On iOS default release version is cleared when no release is set on the Kotlin Multiplatform side. #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jtomanik opened this issue Feb 17, 2025 · 2 comments · May be fixed by #376
Open

Comments

@jtomanik
Copy link

Platform

Apple

Installed

Swift Package Manager

Version

8.42.0

Steps to Reproduce

  1. Do not set release property in SentryOptions in the shared code on Kotlin Multiplatform side
  2. Set properly CFBundleIdentifier, CFBundleShortVersionString, and CFBundleVersion in info.plist in the xcode project used with kotlin multi-platform
  3. Send any kind of event to Sentry (including a crash)
  4. When checking event / issue it has no associated release

Expected Result

According to the kotlin multiplatform SDK documentation:

release
Sets the release. Some SDKs will try to automatically configure a release out of the box

Then according to the iOS SDK documentation:

Setting a Release
If no release name is set, the SDK creates a default combined from CFBundleIdentifier, CFBundleShortVersionString, and CFBundleVersion, for example my.project.name@2.3.12+1234.

Which implies that when no release is set up on the Kotlin Multiplatform side that value will default to whatever platform's SDK behaviour.
In case of iOS that should be a value based on CFBundleIdentifier, CFBundleShortVersionString, and CFBundleVersion values.

Actual Result

Right now the release value transmitted to the sentry backend is null by default.

This is most likely caused by overriding the platform's default value here:

without checking if there is any value in kmpEvent as it is done for some other fields:

@jtomanik
Copy link
Author

After further investigation, it turns out that this happens even earlier when you apply kmp Options to a cocoa options in CocoaSentryOptions.applyCocoaBaseOptions(kmpOptions: SentryOptions)

Specifically on this line:

@romtsn
Copy link
Member

romtsn commented Feb 25, 2025

hi @jtomanik thanks for reporting the issue and sharing your findings, we'll make sure to have this fixed with the next version of the SDK 👍

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