emonCMS-issue in get_feed_data()(feed_model.php)

Hey guys,

Ive experienced a strange(at least to me) behavior of emonCMS to GET requests containing epoch timestamp.

In the mysql db(emoncms), the time field is clearly defined as int(10) which is the epoch rounded to seconds. However GET requests containing int(10) epoch dont work(return nothing), if additional "000" are added, then the correct data are retrieved.

 

Now, this get request returns nothing:

http://IP/emoncms/feed/data.json?id=FEEDID&apikey=APIKEY&start=136422306...

 

but this one, returns correct data:

http://IP/emoncms/feed/data.json?id=FEEDID&apikey=APIKEY&start=136422306...

result: [[1364223140000,"323"],[1364223135000,"322"], etc...

 

So i went to the method get_feed_data() line 256 in feed_model.php and found this:

$start = $start/1000; $end = $end/1000;

....

$time = $row['time'] * 1000;

It seems that the time value is not being divided since it ends up as epoch*1000.

For now, i have commented out this piece of code n it works ok(takes/retrieves correct epoch )

 

What do you think about this?Am i missing something?

I will take a closer look at the whole method soon, but for now, any opinion,elaboration is welcome.

 

 

edit: uncommenting the lines breaks the visualizations