michaelcarter / mixpanel-data-export-js

Mixpanel data export js
91 stars 38 forks source link

Rate limit errors not trapped correctly? #30

Open GeoffreyPlitt opened 5 years ago

GeoffreyPlitt commented 5 years ago

I'm checking data.error correctly, but I still see console.log's with the following error when I query too often with the raw datapoint export:

Oct 18 15:25:46 stardust-backend app/misc_workers3.1:  undefined:1 
Oct 18 15:25:46 stardust-backend app/misc_workers3.1:  [rate limit reached] 
Oct 18 15:25:46 stardust-backend app/misc_workers3.1:   ^ 
Oct 18 15:25:46 stardust-backend app/misc_workers3.1:  SyntaxError: Unexpected token r in JSON at position 1 
Oct 18 15:25:46 stardust-backend app/misc_workers3.1:      at Object.parse (native) 

A few problems:

GeoffreyPlitt commented 5 years ago

@michaelcarter

GeoffreyPlitt commented 5 years ago

@michaelcarter Is this repo maintained at all? Can anyone else help? If you're busy, can you point me in the right direction to fix it?

michaelcarter commented 5 years ago

@geoffreyplitt I’ll try to have a look tomorrow.

michaelcarter commented 5 years ago

Sorry for the delay @GeoffreyPlitt, life getting in the way. Having a look at this now.

GeoffreyPlitt commented 5 years ago

Thanks!

michaelcarter commented 5 years ago

Ok, @GeoffreyPlitt. I was able to recreate your problem locally and I think this branch should fix it for you. Perhaps you could give it a try and let me know?

I've not touched this library in long while, and just about everything is in need of an update. When I next get a free day I'll fix all that up. But if this solves your problem in the mean time I'll get out a bugfix release for you.

GeoffreyPlitt commented 5 years ago

Cool, updated my code, which will run several times overnight, will let you know tomm.

GeoffreyPlitt commented 5 years ago

Looks good to me! I'll watch for the merge and update my package. Thanks again Michael.