catiline
catiline copied to clipboard
spotty promise resolution in IE9
breaking the non-script import part of #66 into it's own issue, basically this
testWorker = cw (input, callback) ->
console.log 'i am the worker ',input
callback input+5
testWorker.data(2).then (res) -> console.log res
setTimeout ->
testWorker.data(3).then (res) -> console.log res
, 1000
# Listen for socket event and update the
# scope with the new data as processed by the above function
$socket.on 'dataProcessingTrend', (theThing) ->
console.log 'chart update recieved'
testWorker.data(4).then (res) -> console.log res
produces
i am the worker 2
7
i am the worker 3
8
chart update recieved
i am the worker 4
chart update recieved
i am the worker 4
@Fresheyeball what happends when you add a second callback to the worker inside the socket, ie
success = (data)->
console.log 'yes ', data
failure = (data)->
console.log 'no ', data
testWorker.data(4).then success,failure
Ok, so I implemented the success
and failure
methods exactly as you have them and received the following in my console:
i am the worker 2
yes 7
i am the worker 3
yes 8
chart update recieved
i am the worker 4
chart update recieved
i am the worker 4
chart update recieved
i am the worker 4
chart update recieved
i am the worker 4
Looks like failure
never fires either. Very odd.
Also thank you so much for your help. Communist is proving to be an excellent lib and I am here to help as much as I can.
if your able to post a jsfiddle that illustrates the error that would be helpful , and thanks for helping bug test it
I will get that too you as soon as I can. Part to the issue there is that I am having trouble reproducing the problem. You will notice the setTimeout
in my testcase, I am not sure what is unique about my event handler that screws up the promise. Once I have that figured out I can provide you a much better fiddle.
Actually if you have any ideas about what might be unique about the southmost function in my testcase that could mess up the promise
it would be very helpful.
that's why I was asking about the fiddle I was curious about what that function is from, angular?
so if I had to guess this would have to do with some of the ie9 stuff resolving synchronously instead of async so try this again it may have been fixed. Also now you can use console.log
inside a worker.
Will give it a shot tomorrow. Thanks for providing excellent support :)
Sorry I have not gotten a chance to test yet. I will ASAP. please stand by.
Ok, I've tested it. Promise is still not getting resolved in IE9.
Ok so I need a fiddle from you then that reproduces it
I'm working on it. Been swamped.
also fyi #97 should in theory help with this (though it depends on the actual problem)
@Fresheyeball this still a problem?
@calvinmetcalf I don't know. I could not get past it and had to purge web workers for the time being. Additionally, and far less helpfully, I was unable to make the problem reproducible.
damn that's double bad, I'm going to clone this issue for now, if you (or anyone else) is able to reproduce it I can open it back up.
Sounds good. Pretty lame overall