fxb / javascript-last.fm-api

last.fm API bindings for JavaScript
http://lastfm.felixbruns.de/javascript-last.fm-api/
308 stars 53 forks source link

JSONP Callback Bug #2

Closed clifff closed 11 years ago

clifff commented 13 years ago

Hey fxb,

I've been using this library for a project, and ran into a bug when making concurrent requests to the API. In particular, if calls happen too fast, the JSONP callback name may not be unique, resulting in missed callbacks. All I did was add a counter to help ensure uniqueness.

Here is an example of code that illustrates the bug, and is fixed by the patch:

https://gist.github.com/742237

Clif

ux commented 13 years ago

Yeah. I also got this issue. My my correction was: var jsonp = 'jsonp' + new Date().getTime() + '' + Math.round(1000000 * Math.random());

feross commented 13 years ago

FXB, are you gonna merge this into the main release?

srikiraju commented 13 years ago

It looks like FXB isn't around. clifff, I'm going to be pulling from your branch instead.

younes0 commented 12 years ago

worked fine thanks.

tonype commented 12 years ago

Chiming in to say this fixed an issue I was having as well. I have code that tunes the radio, then immediately gets a playlist. This bug would always result in a missed callback from the tune option.

Thanks!

fxb commented 11 years ago

Slowest response time ever. Sorry ;-)