Guard all SDK entry points when Superwall is unconfigured (LIV-895) - #4
Open
Davedeji wants to merge 1 commit into
Open
Guard all SDK entry points when Superwall is unconfigured (LIV-895)#4Davedeji wants to merge 1 commit into
Davedeji wants to merge 1 commit into
Conversation
On Android, Superwall.instance throws IllegalStateException before configure() has run, and the generated skip-fuse bridge wraps calls in try!, so any pre-configure lifecycle call killed the process (SIGTRAP). Add isConfigured (Superwall.isInitialized on iOS, Superwall.initialized on Android) and gate configure/register/identify/setUserAttributes/reset on it: unconfigured calls are logged no-ops, register does not run its feature block, and configure is now truly idempotent. Also add the missing Tests Skip/skip.yml so swift test runs the package tests under skipstone. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
The LiveTrackz Android beta crashed on every launch (LIV-895): with the prod Superwall key still a placeholder, the app skipped
configurebut later calledidentifyafter auth. On Android,Superwall.instancethrowsIllegalStateExceptionbeforeconfigure()has run, and the generated skip-fuse bridge wraps calls intry!, escalating that to a fatal SIGTRAP. The app now guards its own calls (FourFourSoftware/LiveTrackz-Skipdeji/liv-895-...), but the wrapper itself should never be able to kill the process — this PR adds that defense in depth.Changes
SuperwallManager.isConfigured, backed by the native SDKs' own state:Superwall.isInitializedon iOS (SuperwallKit 4.16.1),Superwall.initializedon Android (superwall-android 2.7.20 companion, verified via javap).configure/register/identify/setUserAttributes/resetall gate on it. Unconfigured calls are logged no-ops (OSLog; no keys or user identifiers logged).registerdoes not run itsfeatureblock while unconfigured — running it would silently grant entitlement.configureis now truly idempotent (second call is ignored).Tests/SkipSuperwallTests/Skip/skip.yml(was missing, soswift testfailed under skipstone) and an unconfigured-lifecycle test.Verification
swift buildandswift test --skip XCSkipTestspass in this package (2/2).gradle :app:assembleDebugcompiles the transpiled Kotlin clean (confirmsSuperwall.initializedon Android), and an emulator launch with a real key shows Superwall initializing normally with no skipped-call warnings.🤖 Generated with Claude Code