Skip to content

Guard all SDK entry points when Superwall is unconfigured (LIV-895) - #4

Open
Davedeji wants to merge 1 commit into
mainfrom
liv-895-unconfigured-guards
Open

Guard all SDK entry points when Superwall is unconfigured (LIV-895)#4
Davedeji wants to merge 1 commit into
mainfrom
liv-895-unconfigured-guards

Conversation

@Davedeji

Copy link
Copy Markdown
Contributor

Summary

The LiveTrackz Android beta crashed on every launch (LIV-895): with the prod Superwall key still a placeholder, the app skipped configure but later called identify after auth. On Android, Superwall.instance throws IllegalStateException before configure() has run, and the generated skip-fuse bridge wraps calls in try!, escalating that to a fatal SIGTRAP. The app now guards its own calls (FourFourSoftware/LiveTrackz-Skip deji/liv-895-...), but the wrapper itself should never be able to kill the process — this PR adds that defense in depth.

Changes

  • New SuperwallManager.isConfigured, backed by the native SDKs' own state: Superwall.isInitialized on iOS (SuperwallKit 4.16.1), Superwall.initialized on Android (superwall-android 2.7.20 companion, verified via javap).
  • configure / register / identify / setUserAttributes / reset all gate on it. Unconfigured calls are logged no-ops (OSLog; no keys or user identifiers logged).
  • register does not run its feature block while unconfigured — running it would silently grant entitlement.
  • configure is now truly idempotent (second call is ignored).
  • Added Tests/SkipSuperwallTests/Skip/skip.yml (was missing, so swift test failed under skipstone) and an unconfigured-lifecycle test.

Verification

  • swift build and swift test --skip XCSkipTests pass in this package (2/2).
  • LiveTrackz-Skip pinned to this branch's head: gradle :app:assembleDebug compiles the transpiled Kotlin clean (confirms Superwall.initialized on Android), and an emulator launch with a real key shows Superwall initializing normally with no skipped-call warnings.

🤖 Generated with Claude Code

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>
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.

1 participant