Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Adjust.processAndResolve method error handling #744

Open
tdesert opened this issue Dec 4, 2024 · 0 comments
Open

Improve Adjust.processAndResolve method error handling #744

tdesert opened this issue Dec 4, 2024 · 0 comments

Comments

@tdesert
Copy link

tdesert commented Dec 4, 2024

Hello,
We've noticed using async version of Adjust.processAndResolve() that several situations lead to this method never completing:

  • When Adjust SDK is initialisation is invalid (e.g. using an invalid API key)
  • When Adjust.disable() has been called (e.g. when user rejected Adjust from CMP)

Here is a pseudo code example of where is can occur:

func handle(deeplink: URL) async {
	guard let adjDeeplink = ADJDeeplink(deeplink: deeplinkURL) else {
		redirect(to: deeplink)
		return
	}

	guard let resolvedDeeplink = await Adjust.processAndResolve(adjDeeplink) else { // <- await never completes here, user will never get redirected
		// Deeplink resolution failed
		redirect(to: deeplink)
		return
	}

	redirect(to: resolvedDeeplink)
}

As we understand this method call should be avoided in the identified situations, we believe it would be safer that the SDK guarantees this method always completes, being successful or not.
The reason being: as soon as we decide to work with Adjust link resolution, all the deeplinks and universal links will have to go through this resolution method before being able to handle the user redirection.
As other situations could lead to unsuccessful redirection than the 2 we have identified above, we need our app to be able to handle this situation gracefully and avoid the worst case scenario where the user is never redirected.

Would it be possible to improve the processAndResolve method with one of those 2 options?

  • Adjust.processAndResolve returns nil when the resolution failed for any reason
  • Adjust.processAndResolve throws an error when resolution failed for any reason

Side note: we could not find reference to Adjust.processAndResolve method in documentation, which refers to resolveLinkWithUrl method that seems to no longer exist in latest Adjust SDK version.

Thanks for you support.

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

No branches or pull requests

1 participant