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

Replace request with the much ligther got module #186

Closed
wants to merge 2 commits into from
Closed

Replace request with the much ligther got module #186

wants to merge 2 commits into from

Conversation

dandv
Copy link
Contributor

@dandv dandv commented Sep 16, 2016

WIP fix for #177

All tests pass when debugging in WebStorm. 5 tests fail when running npm test - can someone help figure out why, maybe @ppannuto?

Also, we keep a retries key in our requestOptions, and request() didn't support a retries option. got() does have one such option.

@connor4312
Copy link
Member

I'm not sure I want to push this change into 4.x. got requires Node 4 since 6.x, and node-influx still targets 0.12. Definitely open to adding it in 5.x though, I'm working on getting a very initial build of that going on Travis right now.

Also, as a side note, I want to be careful with retries as explained here. Influx seems to have gotten better about panicking in the last couple releases but I'm still quite hesitant about adding code that could knock down a cluster 😉

@connor4312
Copy link
Member

connor4312 commented Sep 18, 2016

Alternately we could simply avoid using an external request library and use the built-in http. Keeps the module lighter, and we'll end up having to do some lower-level networking regardless to eventually add UDP support. Thoughts?

@dandv
Copy link
Contributor Author

dandv commented Sep 19, 2016

got requires Node 4 since 6.x

got was more of an experiment into moving away from request. The main problem I ran into was those 5 tests failing unless they're run in WebStorm's debugger. Any ideas as to what's going on there?

But what I wanted to end up with is using node-fetch (which runs on Node v0.10 as well), since this makes the transition to isomorphic-fetch possible for ultimately running in the browser environment (#173, #174, #177).

@ppannuto
Copy link
Contributor

@dandv I'm traveling / spotty for the next few weeks, so not a lot of time to dig in, but you may want to consider rebasing this on top of #164. Previously, the tests needed to run in a strict order for the test suite to run correctly and I had had some transient issues I couldn't track down (I think due to DB state not tearing down correctly in back-to-back tests not test order, but still fixed regardless).

@connor4312
Copy link
Member

Yea, my guess would be that there's some kind of race which is not triggering within WebStorm, but that is triggering (probably as a result of different timing characteristics in request vs got) on Travis.

If you get a chance today to rebase on #164 I would be cool with merging it. If not I'll do so when I get home tonight; I think that would fix the test failures.

@dandv
Copy link
Contributor Author

dandv commented Sep 19, 2016

Thanks @connor4312. Maybe best to let you merge #164 first, then I'll submit another PR instead using node-fetch directly (which I had originally skipped in favor or got just to eliminate the HTTP module as a cause of the failing tests, given that got has a much more similar API to request).

@connor4312
Copy link
Member

connor4312 commented Sep 19, 2016

Sure, I would be fine with using a fetch API and I see the value in making node-influx work in browsers.

I'm not hugely tied to using request, or similar modules. Never much liked their API nor ita bloat, and it isn't exposed externally so it can be swapped out without any breaking changes.

@dandv
Copy link
Contributor Author

dandv commented Sep 23, 2016

Closing in favor of #195, which would've taken me far less if it weren't for node-fetch/node-fetch#165 👎

@dandv dandv closed this Sep 23, 2016
@dandv dandv deleted the got branch September 23, 2016 07:30
@dandv dandv mentioned this pull request Sep 25, 2016
2 tasks
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