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

CancelableRequests timeout too early #579

Open
nickvergessen opened this issue Feb 6, 2023 · 6 comments
Open

CancelableRequests timeout too early #579

nickvergessen opened this issue Feb 6, 2023 · 6 comments

Comments

@nickvergessen
Copy link
Contributor

nickvergessen commented Feb 6, 2023

I downgraded to 2.1.0 of this lib and now it works again.

Seems the problem is from CancelableRequests:
https://github.com/nextcloud/spreed/blob/516d50836a333b146e70c2f8ab1abe6564fa8328/src/store/messagesStore.js#L850

Originally posted by @nickvergessen in #552 (comment)

@nickvergessen
Copy link
Contributor Author

Something is applying a 10s timeout.
If I make talks long polling 9 seconds it works, if it is 10+ the ERR_NETWORK is used to kill the request.
Is it me?

@julien-nc
Copy link
Contributor

Let me try on my side.

@julien-nc
Copy link
Contributor

julien-nc commented Feb 6, 2023

This works fine with @nextcloud/axios v2.3.0:

const CancelToken = axios.CancelToken
const source = CancelToken.source()

const url = generateUrl('/apps/whatever/sleep')
const options = {
	params: {
		duration: 30,
	},
	cancelToken: source.token,
}
axios.get(url, options).then((response) => {
	console.debug('success')
}).catch((error) => {
	console.debug('error', error)
})

setTimeout(() => {
	source.cancel('Request has been cancelled')
}, 35000)

@julien-nc
Copy link
Contributor

With spreed's master (I checked it uses @nextcloud/axios v2.3.0):
image

@nickvergessen
Copy link
Contributor Author

Well we don't set the duration in Talk.
It was never necessary. In talk the response basically act like with a sleep(30);

@nickvergessen
Copy link
Contributor Author

Maybe there was a breaking change in an update or something.
Let me try adding the duration tomorrow to see if that is it.

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

No branches or pull requests

2 participants