-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
[Bug] [Android] Timeout argument ignored, global argument taken #471
Comments
Hi @ZweiEuro, I think we forgot to update the documentation when #404 was implemented. Would you please try to set the values for |
Hi @silkimen, this.http.setRequestTimeout(custom_timeout ? custom_timeout : this.timeout); // This has an effect
this.http
.sendRequest("http://" + (ip ? ip : this.device.getIP()) + ":" + this.hostPort + "/api/v1/command", {
method: "post",
data: body,
timeout: this.timeout, // this has no effect
headers: { "Content-Type": "application/json" },
serializer: "json",
responseType: "json",
}) You mean i should be doing this ? //this.http.setRequestTimeout(custom_timeout ? custom_timeout : this.timeout); // This has an effect
this.http
.sendRequest("http://" + (ip ? ip : this.device.getIP()) + ":" + this.hostPort + "/api/v1/command", {
method: "post",
data: body,
connectTimeout: this.timeout, // <------
headers: { "Content-Type": "application/json" },
serializer: "json",
responseType: "json",
}) |
I had the same issue and came here to find this already reported... I tried adding additional properties to the options object |
I think it fixed my issue as well @bluwduch I am just asking for docs and confirmation |
I have had the same problem, it would be nice if the documentation could be updated. |
Describe the bug
My app makes 2 kinds of http calls:
To a local device which needs 1s timeout in order to quickly detect if it is down.
To a server which needs 10s timeout to work reliably since that can take longer than 1s.
I wanted to avoid setting the timeout globally with
this.http.setRequestTimeout(...);
But when I set it only via the argumetns of:
.sendRequest(...,{... timeout:1});
Its ignored. If a timeout occurs it's always exactly after 60 seconds which is the default.
Setting the global default will overwrite it for all requests.
This makes me think that the argument of the sendrequest timeout is ignored in general and only the global argument is taken.
System info
Are you using ionic-native-wrapper?
No, at least i can't find it anywhere in package.json or in config.xml of the app.
Minimum viable code to reproduce
The text was updated successfully, but these errors were encountered: