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

Feature Request: Support request abortion #161

Open
RTK opened this issue May 30, 2022 · 1 comment
Open

Feature Request: Support request abortion #161

RTK opened this issue May 30, 2022 · 1 comment

Comments

@RTK
Copy link

RTK commented May 30, 2022

Subject of the issue

Right now, the plugin's feature of request abortion (https://github.com/silkimen/cordova-plugin-advanced-http#abort) is not supported. When a request via HttpClient gets aborted (no active subscribers on observable), the request will still be completed, even though the response will not be used.

Environment

  • version of angular
  • version of ionic-native-http-connection-backend - 3.3.0
  • version of @ionic/angular - does not matter
  • version of @awesome-cordova-plugins/http - 5.43.0

Steps to reproduce

Integrate native http backend, create a request via httpClient, unsubscribe before request ends, observe the native request getting completed and not aborted.

Expected behaviour

Requests should be canceable via the requestId property returned by the plugin. In a completer function the requestId can be used to abort the request.

Actual behaviour

Since this implementation relies on the awesome-cordova wrapper, which wraps the plugins functionalities in a Promise, the possibility to cancel a request gets lost. If you unsubscribe from a request it will complete.

@sneas
Copy link
Owner

sneas commented May 30, 2022

Hi Rouven,

Thank you a lot for this issue! I was not aware of the newly created abort functionality of the cordova-plugin-advanced-http, but I've been waiting for it for a while. Cheers, to @silkimen 💐

Unfortunately, I'm not sure when I'll have time to update ionic-native-http-connection-backend, because I'm busy with something else.

If you or anyone else have time to pick this one up, feel free to do that. I can provide support if needed. Otherwise, I'll pick it up myself when I'm less busy.

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

No branches or pull requests

2 participants