Repository navigation
chore(jvm): keep PostHogConfig copy and default-argument constructor linkable - #116
Merged
turnipdabeets merged 4 commits intoNov 9, 2026
Merged
Conversation
…nkable Adding evaluationContexts changed the data class copy and the synthetic default-argument constructor, so JVM code compiled against 0.10 that calls copy(...) or PostHogConfig(..., capturePush...= ...) hit NoSuchMethodError. Add a hidden 20-parameter copy and give the retained 20-parameter constructor its defaults back. Also drop the duplicated evaluationContexts assignment on Android and JVM.
|
turnipdabeets
marked this pull request as ready for review
November 8, 2026 17:30
marandaneto
approved these changes
Nov 9, 2026
marandaneto
left a comment
Member
There was a problem hiding this comment.
The code looks good; no qualifying findings. Verdict: correct.
turnipdabeets
added a commit
that referenced
this pull request
Nov 9, 2026
…115) * feat: add PostHog.setAppLanguage() and send $locale as BCP 47 on JVM Set $app_language on every platform: forwarded to the native SDKs on Android, JVM, iOS and macOS, and added in before_send on JS and Wasm, where posthog-js has no such property. Document the Compose Multiplatform resources gap in MIGRATION.md. * fix(web): skip $app_language when denylisted or on minimal flag-called events * fix(web): drop $app_language on JS and Wasm until posthog-js supports it * docs: scope setAppLanguage() to native targets and note it needs setup() on Android and JVM * chore: give the JS and Wasm setAppLanguage no-ops a body so detekt passes * chore(jvm): keep PostHogConfig copy and default-argument constructor linkable (#116) * fix(jvm): keep PostHogConfig copy and default-argument constructor linkable Adding evaluationContexts changed the data class copy and the synthetic default-argument constructor, so JVM code compiled against 0.10 that calls copy(...) or PostHogConfig(..., capturePush...= ...) hit NoSuchMethodError. Add a hidden 20-parameter copy and give the retained 20-parameter constructor its defaults back. Also drop the duplicated evaluationContexts assignment on Android and JVM. * test(config): use assertNull for the null evaluation contexts check * chore: re-run CI after retitling to chore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Stacked on #115. Adding
evaluationContextsto thePostHogConfigprimary constructor changed two JVM signatures that 0.10 consumers link against, and #115 only kept the plain 20-parameter constructor:copy(<20 params>)/copy$default(...)config.copy(...)NoSuchMethodError<init>(<20 params>, int, DefaultConstructorMarker)PostHogConfig(...)calls that namecapturePushNotificationSubscriptionsorcapturePushNotificationOpenedand rely on defaultsNoSuchMethodErrorChanges:
@Deprecated(level = HIDDEN)20-parametercopy, matching the existing hiddenapiKeycopyoverloads. Hidden keeps it out of Kotlin overload resolution.PostHogConfig(projectToken = ...)still picks the 18-parameter overload (fewest unused defaults), and calls passingevaluationContextsonly match the primary constructor.evaluationContexts = config.evaluationContextsline inPostHog.android.ktandPostHog.jvm.kt.No changeset: nothing changes relative to 0.10.
💚 How did you test it?
PostHogConfigJavaTestthat callcopy$defaultand the default-argument constructor by their 0.10 signatures, as prebuilt Kotlin code does. Thecopytest fails withNoSuchMethodExceptionwithout the fix;javapconfirmed the constructor signature was missing too../gradlew :posthog-kmp:jvmTest(all pass),:posthog-kmp:compileAndroidMain,:posthog-kmp:compileKotlinJs. Run locally againstcom.posthog:posthog:7.0.0frommavenLocalsince it isn't on Maven Central yet.detektreports 2EmptyFunctionBlockissues inPostHog.js.kt/PostHog.wasmJs.ktthat already exist on feat: add PostHog.setAppLanguage() and send $locale as BCP 47 on JVM #115. The iOS compile didn't run locally because the Swift package resolve failed.📝 Checklist
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code, from a pre-release review of #115. The repo has no binary-compatibility-validator or
.apidumps, so the reflection tests are the guard.🤖 Generated with Claude Code