Repository navigation
fix(ktor): [Ktor 3.6 2] Preserve Ktor 3.0 runtime compatibility - #6517
Conversation
Avoid inlining Ktor 3.6's AttributeKey factory. The inlined code references a TypeInfo constructor unavailable in older Ktor 3.x runtimes. Construct TypeInfo explicitly through its stable two-argument constructor instead.
📲 Install BuildsAndroid
|
* test(ktor): Add Ktor 3.0 compatibility suite Compile the production integration against the catalog Ktor version while compiling and running the existing tests against Ktor 3.0.0. Add the compatibility suite to check so inline API binary incompatibilities fail CI. * test(ktor): Simplify Ktor 3.0 suite configuration Use Ktor's enforced platform to pin all compatibility test artifacts to 3.0.0 instead of maintaining a custom resolution strategy. Reuse the standard test source directories so the suite follows source changes. Co-Authored-By: Claude <noreply@anthropic.com> * Update sentry-ktor-client/build.gradle.kts Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io>
4583d57
into
dependabot/gradle/ktorClient-3.6.1
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d28f60a. Configure here.
|
|
||
| kotlin.target.compilations.named("testKtor300") { | ||
| associateWith(kotlin.target.compilations.getByName("main")) | ||
| } |
There was a problem hiding this comment.
Test suite misses production classes
High Severity
The testKtor300 suite never depends on project(), so main output can be missing from the Test runtime classpath. Extra JVM test suites do not inherit production classes the way built-in test does, and associateWith only friends the Kotlin compilation. Without the plugin jar on that classpath, the suite cannot load SentryKtorClientPlugin and does not verify Ktor 3.0.0 runtime compatibility.
Triggered by project rule: PR Review Guidelines for Cursor Bugbot
Reviewed by Cursor Bugbot for commit d28f60a. Configure here.
* chore(deps): bump ktorClient from 3.0.0 to 3.6.1 Bumps `ktorClient` from 3.0.0 to 3.6.1. Updates `io.ktor:ktor-client-core` from 3.0.0 to 3.6.1 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/3.6.1/CHANGELOG.md) - [Commits](ktorio/ktor@3.0.0...3.6.1) Updates `io.ktor:ktor-client-java` from 3.0.0 to 3.6.1 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/3.6.1/CHANGELOG.md) - [Commits](ktorio/ktor@3.0.0...3.6.1) --- updated-dependencies: - dependency-name: io.ktor:ktor-client-core dependency-version: 3.6.1 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.ktor:ktor-client-java dependency-version: 3.6.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix(ktor): [Ktor 3.6 2] Preserve Ktor 3.0 runtime compatibility (#6517) * fix(ktor): Preserve Ktor 3.0 runtime compatibility Avoid inlining Ktor 3.6's AttributeKey factory. The inlined code references a TypeInfo constructor unavailable in older Ktor 3.x runtimes. Construct TypeInfo explicitly through its stable two-argument constructor instead. * test(ktor): [Ktor 3.6 3] Add Ktor 3.0 compatibility suite (#6520) * test(ktor): Add Ktor 3.0 compatibility suite Compile the production integration against the catalog Ktor version while compiling and running the existing tests against Ktor 3.0.0. Add the compatibility suite to check so inline API binary incompatibilities fail CI. * test(ktor): Simplify Ktor 3.0 suite configuration Use Ktor's enforced platform to pin all compatibility test artifacts to 3.0.0 instead of maintaining a custom resolution strategy. Reuse the standard test source directories so the suite follows source changes. Co-Authored-By: Claude <noreply@anthropic.com> * Update sentry-ktor-client/build.gradle.kts Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io>


PR Stack (Ktor 3.6)
📜 Description
Construct the Ktor client plugin's attribute keys with explicit
TypeInfovalues instead of using Ktor's inlineAttributeKeyfactory.💡 Motivation and Context
When compiled against Ktor 3.6.1, the inline factory embeds a call to a new three-argument
TypeInfoconstructor. Running those compiled SDK classes with older Ktor 3.x versions then fails withNoSuchMethodError.The explicit construction uses the stable two-argument
TypeInfoconstructor and preserves runtime compatibility with Ktor 3.0.0 through 3.6.1.💚 How did you test it?
./gradlew spotlessApply updateKotlinAbiSentryKtorClientPluginTesttests after compiling once against Ktor 3.6.1 and replacing only the Ktor runtime dependencies with 3.0.0, 3.1.3, 3.2.3, 3.3.3, 3.4.3, 3.5.1, and 3.6.1; all passed./gradlew :sentry-ktor-client:checkKotlinAbijavapthat the compiled plugin callsTypeInfo(KClass, KType)and does not referenceTypeInfo(KClass, boolean, KType)📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
None.
#skip-changelog