joola / joola.sdk

Joola's Software Development Kit (SDK)
https://joo.la
Other
3 stars 3 forks source link

joola returns errors when trying to query an empty timeframe #122

Closed orweinberger closed 9 years ago

orweinberger commented 10 years ago

On some types of queries, joola will return the following error when trying to query an empty timeframe:

Uncaught Error: Failed to route action [fetch]: Cannot call method 'hasOwnProperty' of undefined

This is the query I'm running:

var openCount = {
      query: {
        timeframe: 'last_week',
        interval: 'day',
        dimensions: [
          {key: 'timestamp', collection: campaignId}
        ],
        metrics: [
          {
            key: 'uniqueopens',
            name: 'uniqueopens',
            aggregation: 'ucount',
            datatype: 'number',
            dependsOn: ['ip'],
            collection: campaignId
          }
        ],
        filter: [
          ['opens', 'gt', 0]
        ],
        realtime: true

      }
    };
    $('#openCount').Metric(openCount, function (err, result) {
      if (err)
        throw new Error(err);
    });
orweinberger commented 10 years ago

I believe this is mostly related to the last_week timeframe, things seems different when changing the timeframe to last_7_days