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

timeouts #63

Closed
wants to merge 1 commit into from
Closed

timeouts #63

wants to merge 1 commit into from

Conversation

m-mcgowan
Copy link
Contributor

@m-mcgowan m-mcgowan commented May 16, 2017

adds timeouts based on #20, with unit tests

[CH4422]

@m-mcgowan m-mcgowan requested a review from monkbroc May 16, 2017 19:53
@coveralls
Copy link

coveralls commented May 16, 2017

Coverage Status

Coverage increased (+0.3%) to 74.595% when pulling 84519f3 on feature/timeouts into a22810a on develop.

@coveralls
Copy link

coveralls commented May 16, 2017

Coverage Status

Coverage increased (+0.3%) to 74.595% when pulling 84519f3 on feature/timeouts into a22810a on develop.

@@ -2,5 +2,6 @@ export default {
baseUrl: 'https://api.particle.io',
clientSecret: 'particle-api',
clientId: 'particle-api',
tokenDuration: 7776000 // 90 days
tokenDuration: 7776000, // 90 days
timeout: 60000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this value going to be used anywhere? It sets particle.timeout = 60000 but this.timeout is not used in the Particle class. If it's unused let's remove this line.

@@ -137,6 +145,9 @@ export default class Agent {
if (query) {
req.query(query);
}
if (timeout!==undefined) {
req.timeout(timeout);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the user-facing behavior of a timeout? This is an public interface change. An opt-in one but a change nevertheless. How would a user program deal with a timeout vs an HTTP error?

@@ -137,6 +145,9 @@ export default class Agent {
if (query) {
req.query(query);
}
if (timeout!==undefined) {
req.timeout(timeout);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the user-facing behavior of a timeout? Adding a timeout is a public interface change since it will affect the promise rejection. We need to document what will happen when there's a timeout compared to an HTTP error. This is more of a documentation comment.

@m-mcgowan m-mcgowan closed this Jul 18, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants