Use typed Android JSON-RPC params#300
Open
kiftio wants to merge 1 commit into
Open
Conversation
This was referenced Jun 18, 2026
Merged
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
11 tasks
kiftio
commented
Jun 18, 2026
| decode = { params -> | ||
| ((params as? JsonObject)?.get("url") as? JsonPrimitive)?.contentOrNull | ||
| ?.takeIf { it.isNotBlank() } | ||
| json.decodeFromJsonElement<WindowOpenParams>(params ?: JsonNull).url |
Contributor
Author
There was a problem hiding this comment.
think we've lost some null safety here
8b22ab3 to
80de055
Compare
6c13b4c to
1880dcb
Compare
80de055 to
1d0dac2
Compare
1880dcb to
b042647
Compare
1d0dac2 to
1f5c3e9
Compare
b042647 to
940fa40
Compare
1f5c3e9 to
23452c0
Compare
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.

What changes are you making?
Replaces manual JSON field extraction logic in
CheckoutProtocolandEmbeddedCheckoutProtocolwith typed, serializable data classes (ReadyParams,CheckoutParams,ErrorParams,WindowOpenParams). Instead of castingJsonElementtoJsonObjectand manually extracting fields, params are now decoded directly viajson.decodeFromJsonElementinto the appropriate typed wrapper.As a side effect, the
ec.readyhandler now treats non-string values in thedelegatearray (e.g.null,{}) as a parse error rather than silently ignoring them, which is reflected in the updated test expectations.How to test
ec.readywith a mixed-typedelegatearray (e.g.["window.open", null, {}]) now returns a JSON-RPC parse error (-32700) rather than a success response with partial results.ec.error,ec.window.open_request, and checkout lifecycle events (ec.checkout.start, etc.) continue to decode correctly when valid params are provided, and returnnullgracefully on invalid input.Before you merge
Important
platforms/swift/README.mdand/orplatforms/android/README.md)Releasing a new Swift version?
ShopifyCheckoutKit.podspecplatforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swiftplatforms/swift/CHANGELOG.mdplatforms/swift/README.md(major version only)Releasing a new Android version?
versionNameinplatforms/android/lib/build.gradleplatforms/android/CHANGELOG.mdplatforms/android/README.mdTip
See the Contributing documentation for the full release process per platform.