This repository was archived by the owner on Oct 16, 2025. It is now read-only.
feat: apply unified error + init coalescing#6
Merged
Conversation
- Use StoreKit RenewalState for subscription status and encode as string for JSON compatibility. - Add default messages for all error codes and expose errorMessages() for bridging. - Fill missing error code mappings and disable markdownlint MD013/MD033.
Replace PurchaseError struct with OpenIapErrorEvent under OpenIapError namespace and re-export via typealiases for backward compatibility. Move constants and default messages to OpenIapError namespace to avoid duplication.
Remove legacy PurchaseError and OpenIapPurchaseError; integrate error event into OpenIapError as OpenIapErrorEvent. Update all references, listeners, and examples to use the unified type and OpenIapError E_* constants. Remove backward-compat typealiases as requested.
Add initTask to OpenIapModule to deduplicate concurrent initConnection calls and have ensureConnection() auto-initialize when needed. Cancel in-flight init on endConnection to prevent races.
…wn enum Unify event payload as OpenIapError with defaultMessage() factory and move all E_* codes + errorCodes() under it. Rename thrown enum to OpenIapFailure and update all throw sites. Replace hardcoded event messages with defaultMessage-based factories.
Deduplicate initialization logic by inlining the coalescing behavior into initConnection() and calling it from ensureConnection(). This reduces indirection and keeps init guarding in one place.
Resolve merge conflicts by keeping unified error (OpenIapError + OpenIapFailure), updated init coalescing, and example/type changes. Also retain markdownlint config additions.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Overview
Error Handling
E_*code sourceerrorCodes/errorMessagesfor bridgingEnum Changes