Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SDK unity-compatible #2847

Merged
merged 11 commits into from
Sep 8, 2023
Merged

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Jul 18, 2023

馃摐 Description

Since sentry-unity consumes Android SDK artifacts decoupled from each other (e.g. sentry.jar and sentry-android-core.aar do not know about each other), some versions of Unity cannot properly desugar default methods in interfaces during build time.

This results in runtime errors when a default method from sentry.jar is called in sentry-android-core.aar. We've tried to work this around by properly consuming android artifacts using local maven (#2725), but this turned out to be a nightmare to support, because we modify gradle build files via regexes on sentry-unity.

This PR simply converts all default methods that are used in sentry-android-core to be non-default (meaning proper implementations in each interface implementor).

馃挕 Motivation and Context

@bitsandfoxes mental well-being

馃挌 How did you test it?

Manually and automated

馃摑 Checklist

  • I reviewed the submitted code.
  • 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.
  • 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.

馃敭 Next steps

@romtsn
Copy link
Member Author

romtsn commented Jul 18, 2023

The only problem is that this change is binary-incompatible, so if someone is using an older integration version (e.g. sentry-android-timber:6.24.0), and we ship this but they don't update and align the sentry versions, it will crash at runtime. So I'm leaning towards making it a part of v7.0.0 (this shouldn't take longer than 2-3 weeks @bitsandfoxes I hope this should be fine for you?).

@getsentry getsentry deleted a comment from github-actions bot Jul 18, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 18, 2023

Performance metrics 馃殌

Plain With Sentry Diff
Startup time 342.04 ms 391.65 ms 49.61 ms
Size 1.72 MiB 2.26 MiB 547.63 KiB

Previous results on branch: rz/fix/interface-default-methods-in-core

Startup times

Revision Plain With Sentry Diff
f5fba9d 350.57 ms 407.30 ms 56.73 ms

App size

Revision Plain With Sentry Diff
f5fba9d 1.72 MiB 2.26 MiB 547.63 KiB

Copy link
Member

@stefanosiano stefanosiano left a comment

Choose a reason for hiding this comment

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

looks great!
just a note, though. The public interfaces that were changed are technically a breaking change. A note in the changelog is enough, as it will be part of v7 anyway

@romtsn romtsn added this to the 7.0.0 milestone Sep 6, 2023
@romtsn romtsn changed the base branch from main to feat/7.0.0 September 8, 2023 09:17
@romtsn romtsn merged commit c383ed1 into feat/7.0.0 Sep 8, 2023
14 of 17 checks passed
@romtsn romtsn deleted the rz/fix/interface-default-methods-in-core branch September 8, 2023 18:02
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.

None yet

4 participants