Skip to content

Improve Adjust.processAndResolve method error handling #744

Open
@tdesert

Description

@tdesert

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.

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