Skip to content

parse all error messages#152

Merged
kiftio merged 1 commit into
mainfrom
05-19-parse_all_error_messages
May 20, 2026
Merged

parse all error messages#152
kiftio merged 1 commit into
mainfrom
05-19-parse_all_error_messages

Conversation

@kiftio
Copy link
Copy Markdown
Contributor

@kiftio kiftio commented May 19, 2026

What changes are you making?

This should help bring parity with swift


The ec.error notification handler previously decoded only the first error message from the messages array and exposed it directly as a CheckoutError. This change introduces a new CheckoutErrorResponse wrapper type that mirrors the full UCP ec.error params shape, containing:

  • A messages list of CheckoutError objects, allowing consumers to handle multiple errors rather than assuming a single message.
  • An optional continueUrl field for buyer handoff or session recovery.

The CheckoutProtocol.error descriptor now decodes the entire params object into a CheckoutErrorResponse instead of extracting and decoding only the first element of the messages array.

How to test

  1. Trigger a checkout error that returns multiple error messages in the ec.error payload.
  2. Register a handler on CheckoutProtocol.error and verify that all messages in the messages list are accessible, along with the continueUrl if present.
  3. Run the existing unit tests — the updated test in CheckoutProtocolTest covers decoding of multiple messages and the continueUrl field.

Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

Releasing a new Swift version?
  • I have bumped the version in ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated platforms/swift/CHANGELOG.md
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Android version?
  • I have bumped the versionName in platforms/android/lib/build.gradle
  • I have updated platforms/android/CHANGELOG.md
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

Copy link
Copy Markdown
Contributor Author

kiftio commented May 19, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kiftio kiftio force-pushed the 05-19-parse_all_error_messages branch from 60bf0d1 to f0930b1 Compare May 19, 2026 14:21
@kiftio kiftio marked this pull request as ready for review May 19, 2026 14:22
@kiftio kiftio requested a review from a team as a code owner May 19, 2026 14:22
@kiftio kiftio mentioned this pull request May 19, 2026
11 tasks
@kiftio kiftio force-pushed the 05-19-parse_all_error_messages branch from f0930b1 to 46190cc Compare May 19, 2026 14:59
* an optional [continueUrl] for buyer handoff or session recovery.
*/
@Serializable
public data class CheckoutErrorResponse internal constructor(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can this be replaced with ErrorResponse from Models.kt?

@kiftio kiftio force-pushed the 05-19-parse_all_error_messages branch from 46190cc to 0e821b5 Compare May 20, 2026 09:25
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 95%
95.52% (192/201) 92.3% (108/117) 100% (60/60)

@kiftio kiftio force-pushed the 05-19-parse_all_error_messages branch from 0e821b5 to 587d706 Compare May 20, 2026 09:28
@kiftio kiftio merged commit 6156c75 into main May 20, 2026
20 checks passed
Copy link
Copy Markdown
Contributor Author

kiftio commented May 20, 2026

Merge activity

@kiftio kiftio deleted the 05-19-parse_all_error_messages branch May 20, 2026 09:47
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.

2 participants