Skip to content

Fix applyCode typed redeem errors (0.3.1) - #3

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

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

Conversation

@KennyYe

@KennyYe KennyYe commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

React Native 0.3.0 could treat a non-2xx /redeemCode body as a successful applyCode() result. This release checks HTTP status on every request, raises TapAppLinkRedeemError for redeem failures, and sends X-TapAppLink-SDK-Version: 0.3.1.

Changes

  • TapAppLinkRedeemError with codes: unknownCode, inactiveCode, wrongEnvironment, network, other
  • Map from body error (unknown_code, inactive_code, wrong_environment) with status fallbacks (404 / 410 / 400)
  • Version header on all requests; bump to 0.3.1
  • Unit tests for legacy 404 + body and new 410/400 paths
  • README redeem example with customer UI states (wrongEnvironment uses Production in the developer warning)

Upgrade note

Upgrade to 0.3.1 so applyCode() raises a typed error instead of returning error JSON as success.

Test plan

  • npm test (including redeem error cases)
  • npm run typecheck / lint / build
  • CI green on this PR
  • After squash-merge, tag v0.3.1 and confirm release workflow publishes
Open in Web Open in Cursor 

Check HTTP status on every request, map redeem failures to
TapAppLinkRedeemError, send X-TapAppLink-SDK-Version, and document
customer UI states for each result.

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