Repository navigation
Conversation
…call UserApi.deletePassword had a bare @post, so Retrofit threw "Missing either @post URL or @url parameter." the first time User.deletePassword() ran. Point it at ApiPaths.User.Password.DELETE (POST me/remove_password). SessionApi.revokeSession declared its @query before its @path, which Retrofit rejects, so Session.revoke() threw too. Put the @path first. The per-API tests mock these interfaces, so Retrofit never parsed them. ServiceInterfaceValidationTest builds every service ClerkApi creates with validateEagerly(true). DeviceAttestationApi is excluded: its getChallenge() returns void and nothing has called it since #571. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spotless ratchets from origin/main, so it checks Clerk.kt only when a change touches it. The next commit touches it, and main's copy no longer matches the pinned ktfmt output. This commit changes formatting only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing has called DeviceAttestationHelper since #571 removed the startup flow and DeviceAssertionMiddleware. Delete the helper, its test, DeviceAttestationApi, the ClerkApi wiring, the reset hook, the API path, and the Play Integrity dependency. Deprecate the public Constants.Attestation object instead of removing it, so this change does not break consumers who reference it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: clerk/clerk-android/.coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
swolfand
left a comment
There was a problem hiding this comment.
The deletion is complete, and deprecating Constants.Attestation instead of deleting it keeps the API compatible. Two things to watch, neither blocking: (1) The base isn't main, so CI ran only detekt and semgrep here. Retarget to main after #997 merges and let the unit tests run. (2) config/bin/ktfmt bundles ktfmt 0.54 while spotless uses 0.64, so the pre-commit hook will undo the Clerk.kt reformat. Bumping the hook binary is worth a follow-up.
Withdrawing until this is retargeted to main and the unit-test jobs pass; CI has only run detekt/semgrep on this branch.
…23da # Conflicts: # source/api/src/main/kotlin/com/clerk/api/network/api/SessionApi.kt # source/api/src/test/java/com/clerk/api/network/api/ServiceInterfaceValidationTest.kt
Nothing has called DeviceAttestationHelper since #571 removed the startup flow and DeviceAssertionMiddleware. Delete the helper, its test, DeviceAttestationApi, the ClerkApi wiring, the reset hook, the API path, and the Play Integrity dependency. Drop the ServiceInterfaceValidationTest exclusion and the detekt baseline entries that only existed for the deleted code. Deprecate the public Constants.Attestation object instead of removing it, so this change does not break consumers who reference it. Reuses the approach from #1001, which was closed without being merged.
Nothing has called DeviceAttestationHelper since #571 removed the startup flow and DeviceAssertionMiddleware. Delete the helper, its test, DeviceAttestationApi, the ClerkApi wiring, the reset hook, the API path, and the Play Integrity dependency. Drop the ServiceInterfaceValidationTest exclusion and the detekt baseline entries that only existed for the deleted code. Deprecate the public Constants.Attestation object instead of removing it, so this change does not break consumers who reference it. Reuses the approach from #1001, which was closed without being merged.
Nothing has called DeviceAttestationHelper since #571 removed the startup flow and DeviceAssertionMiddleware. Delete the helper, its test, DeviceAttestationApi, the ClerkApi wiring, the reset hook, the API path, and the Play Integrity dependency. Drop the ServiceInterfaceValidationTest exclusion and the detekt baseline entries that only existed for the deleted code. Deprecate the public Constants.Attestation object instead of removing it, so this change does not break consumers who reference it. Reuses the approach from #1001, which was closed without being merged.
…and dependencies (#1016) * refactor(api): delete unused device attestation Nothing has called DeviceAttestationHelper since #571 removed the startup flow and DeviceAssertionMiddleware. Delete the helper, its test, DeviceAttestationApi, the ClerkApi wiring, the reset hook, the API path, and the Play Integrity dependency. Drop the ServiceInterfaceValidationTest exclusion and the detekt baseline entries that only existed for the deleted code. Deprecate the public Constants.Attestation object instead of removing it, so this change does not break consumers who reference it. Reuses the approach from #1001, which was closed without being merged. * refactor(api): delete reflection helpers that only build unread annotations ClerkApiResultConverterFactory built a ResultType annotation for the error type, and ClerkApiResultCallAdapterFactory built a StatusCode annotation for each failed response. Both were appended to the annotations handed to the next converter, which is the kotlinx serialization converter, and it never reads them. Nothing else did either. Delete the two annotations and the Types, ParameterizedTypeImpl, WildcardTypeImpl, and GenericArrayTypeImpl helpers that existed only to build them, and pass the caller's annotations through unchanged. Pin that pass-through with a converter factory test. * build(api): drop unused kotlinx-datetime and lifecycle-viewmodel dependencies Nothing in :source:api imports kotlinx.datetime or the ViewModel APIs from lifecycle-viewmodel-ktx, and both were implementation dependencies, so no public signature exposes their types. They still reached every app's runtime classpath. Remove them, and the now-unused kotlinx-datetime catalog entry. The lifecycle-viewmodel catalog entry stays because the samples and e2e app use it directly; :source:ui gets the ViewModel APIs from lifecycle-viewmodel-compose.
Why
Nothing in the SDK has called device attestation since #571 removed the startup flow and
DeviceAssertionMiddleware. The helper, its API, and the Play Integrity dependency stayed behind.DeviceAttestationApi.getChallenge()is also a non-suspendvoidmethod that Retrofit rejects, so #997 had to exclude it fromServiceInterfaceValidationTest. This PR deletes the dead code and the exclusion.Scope
DeviceAttestationHelper,DeviceAttestationHelperTest, andDeviceAttestationApi.ClerkApi.deviceAttestation, theDeviceAttestationHelper.clearCache()call inClerk.reset(), andApiPaths.Client.DeviceAttestation.google-playIntegritycatalog entry andimplementation(libs.google.playIntegrity).DeviceAttestationHelperandDeviceAssertionMiddleware.DeviceAttestationApiexclusion fromServiceInterfaceValidationTest.Constants.Attestationinstead of deleting it. Nothing reads it, but it is part of the publicConstantsobject, and deleting it would break any app that references it. Delete it in the next major version.Clerk.ktin a separate commit. Spotless checks only files that differ fromorigin/main, and theClerk.ktonmainno longer matches the pinned ktfmt output. That commit changes formatting only.Blast Radius
Apps that use the SDK no longer get
com.google.android.play:integrityor its dependencycom.google.android.play:core-commonat runtime. The SDK declared Play Integrity asimplementation, so apps never compiled against it through the SDK. An app breaks only if it loads Play Integrity classes at runtime without declaring the dependency itself.Two open PRs touch the same code. #985 edits
DeviceAttestationHelperTest.kt, which this PR deletes. Resolve that conflict by deleting the file. #910 addsClerkProtect.reset()next to the removedclearCache()call. Resolve that conflict by keepingClerkProtect.reset().Verification
./gradlew :source:api:testDebugUnitTest :source:api:spotlessCheck :source:api:detekton JDK 21 passes with 752 tests and 0 failures.ServiceInterfaceValidationTestnow passes with no exclusion.DeviceAttestation,playIntegrity,DeviceAssertion, andConstants.Attestationfinds no matches.:source:api:dependencies --configuration releaseRuntimeClasspathbefore and after this change differ by onlycom.google.android.play:integrityandcom.google.android.play:core-common.🤖 Generated with Claude Code
Summary by CodeRabbit