-
Notifications
You must be signed in to change notification settings - Fork 48
Description
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.