Closed brendanpward closed 4 years ago
Hello Brendan, good pickup, thanks for debugging and doing a PR. Just wondering if you tested this without a retention policy specification when the String pointer will be null. Unless I'm overlooking something, I think it will blow up the printf. I think yopu will need to break up the existing printf into two and add a conditional printf between to insert the retention policy conditionally if one exists. See how it's done in the sendPost state.
Right . . . I think I'll be breaking more than I'd be fixing with this current code. Thanks for pointing this out. I'd missed that the retention policy was optional and could be null. I'll get that case tested and if necessary, break it up and set the conditional printf as you suggested.
Putting together next release I took care of this. Closing.
Found this bug as my IoTaWatt resets on occasion and begins re-uploading all of the data to influxDB beginning at the "upload history from" date. Wireshark collected the following after a reboot:
I found that the reason for this is because IoTaWatt was not selecting my retention policy as it's a non-default policy in influxDB, and the code currently does not specify the policy on query.
Queried with the retention policy:
This modification should now insert the retention policy into the query.