Skip to content

Paywall processing hangs forever when handleDeepLink is called before register #388

@andrew-k-21-12

Description

@andrew-k-21-12

Tried versions: 2.4.0 and 2.7.9.
Reproduced in Android 14.

The hanging happens because currentTask?.await() waits forever in SerialTaskManager#addTask.

A minimal example to reproduce the issue:

// After Superwall has been configured.
GlobalScope.launch {
	// On the second iteration we will get into this hanging — no more paywalls will be shown.
	while (true) {
		delay(3_000)
		Superwall.instance.handleDeepLink(Uri.parse("some random URI not configured anyhow by Superwall"))
		Superwall.instance.register("some actual placement configured to show a paywall", handler = PaywallPresentationHandler().apply {
			onPresent { Timber.d("onPresent") }
			onError { Timber.d("onError $it") }
			onDismiss { info, result -> Timber.d("onDismiss") }
			onSkip { Timber.d("onSkip") }
		}) {
			Timber.d("feature")
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions