Skip to content

SDK 0.3.1: typed applyCode errors and HTTP status checks - #3

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/sdk-0-3-1-typed-redeem-errors-ef35
Oct 9, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/sdk-0-3-1-typed-redeem-errors-ef35

Conversation

@KennyYe

@KennyYe KennyYe commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix release 0.3.1 for the redeem / applyCode() path.

  • Check HTTP status on every SDK request; never return an error body as success.
  • Add sealed TapAppLinkRedeemException (UnknownCode, InactiveCode, WrongEnvironment, Network, Other), mapped from body error and status fallbacks (legacy 404 + new 410/400).
  • Send X-TapAppLink-SDK-Version: 0.3.1 on all requests.
  • applyCode callback is now (Result<JSONObject>) -> Unit so failures are typed (breaking vs 0.3.0 callback).
  • Unit tests for each case, CHANGELOG upgrade note, README UI-state mapping (including wrongEnvironment developer warning with Production, not Live).

Test plan

  • ./gradlew test ktlintCheck lintRelease
  • CI green on this PR
  • Squash-merge, tag v0.3.1, confirm Release workflow
Open in Web Open in Cursor 

Check HTTP status on every request, map redeem failures to
TapAppLinkRedeemException, send X-TapAppLink-SDK-Version, and document
UI states for each result. applyCode now delivers Result<JSONObject>.

Co-authored-by: Kenny Ye <KennyYe@users.noreply.github.com>
@KennyYe
KennyYe marked this pull request as ready for review October 9, 2026 17:09
@cursor
cursor Bot merged commit 5bbfb13 into main Oct 9, 2026
1 check passed
@cursor
cursor Bot deleted the cursor/sdk-0-3-1-typed-redeem-errors-ef35 branch October 9, 2026 17:09
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