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

Bug in ping() method #497

Open
PetrJajtner opened this issue May 11, 2020 · 3 comments
Open

Bug in ping() method #497

PetrJajtner opened this issue May 11, 2020 · 3 comments

Comments

@PetrJajtner
Copy link

PetrJajtner commented May 11, 2020

Expected Behavior

In pool/ping() is included 'path' from constructor config attribute together with '/ping'
Fix: https://node-influx.github.io/file/src/pool.js.html - line 188 ->
path: `${url.path}${path}`.replace(/\\/+/, '/')

Actual Behavior

The path parameter from config settings is missing in pool/ping() method
https://node-influx.github.io/file/src/pool.js.html - line 185, 188 resp.

Steps/Code to Reproduce the Problem

  1. Set path in constructor: client = new InfluxDB({path: '/influx'});
  2. Use ping method: client.ping(Infinity); // -> online: false, because not [server]/influx/ping but [server]/ping
import { InfluxDB } from 'influx';
const client = new InfluxDB({path: '/influx'});
await client.ping(Infinity); // online: false due to incorrect URL path

Specifications

  • Version: 5.5.1
  • Platform:
  • Subsystem:
@stale
Copy link

stale bot commented Jul 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 11, 2020
@stale stale bot closed this as completed Jul 18, 2020
@bencevans bencevans reopened this Jul 22, 2020
@stale stale bot removed the stale label Jul 22, 2020
@bencevans
Copy link
Member

Thanks for reporting. A Pull Request fixing this would be very welcome 😸

@rnd-debug
Copy link
Contributor

Btw, providing Infinity as param will fail with: RangeError [ERR_OUT_OF_RANGE]: The value of "timeout" is out of range. It must be a non-negative finite number. Received Infinity

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

No branches or pull requests

3 participants