Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

There is no way to cancel a request #149

Open
wbinarytree opened this issue Sep 4, 2018 · 0 comments
Open

There is no way to cancel a request #149

wbinarytree opened this issue Sep 4, 2018 · 0 comments

Comments

@wbinarytree
Copy link

version : 'com.twitter.sdk.android:twitter-core:3.3.0'

I use custom event for reqeust the tempToken using OAuth1aService::requestTempToken.
The code is

    public void requestTempToken(final Callback<OAuthResponse> callback) {
        final TwitterAuthConfig config = getTwitterCore().getAuthConfig();
        final String url = getTempTokenUrl();

        api.getTempToken(new OAuth1aHeaders().getAuthorizationHeader(config, null,
                buildCallbackUrl(config), "POST", url, null)).enqueue(getCallbackWrapper(callback));
    }

So it enqueue the request directly without returning anything. That's means there is access to the call and hence no way to cancel that request. Which can lead to an memory leak or crash after Activity destroyed.

Can you add the call himself as an return value? Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant