twilio-node icon indicating copy to clipboard operation
twilio-node copied to clipboard

Alerts Ignores Time Specified

Open mebuckler opened this issue 6 years ago • 2 comments

Issue Summary

When using the Alert endpoint on the Monitor Rest API, the code ignores the time specified and will return the whole days worth of results.

Steps to Reproduce

  1. Review alerts and pick a startDate and endDate including time, that will exclude some alerts from the day.
  2. Run query on alerts specifying startDate and endDate.
  3. You will see results outside of the time specified.

Code Snippet

This example shows trying to grab logs from the last minute.

const now = Date.now();
const startDate = new Date(now - 60 * 1000)
const endDate = new Date(now);

const client = new Twilio(accountSid, authToken);
const alerts = await client.monitor.alerts.list({
    startDate,
    endDate
});

Exception/Log

# paste exception/log here

Technical details:

  • twilio-node version: 3.42.2
  • node version: 12

mebuckler avatar Jun 11 '20 15:06 mebuckler

Working on updating the upstream API definition so the fix doesn't get overwritten. And testing as this will impact the other 5 languages.

childish-sambino avatar Jun 11 '20 16:06 childish-sambino

Approved and merged. The other languages will be updated as well on the next release cycle.

childish-sambino avatar Jun 11 '20 19:06 childish-sambino