-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'failed' connection state is not triggered #21
Comments
I just tried this now: alert("Final pusher state: " + pusher.connection.state); and outputs 'failed'. But the event is not triggered... |
Hiya. Thanks a lot for reporting this. I'm looking into it. |
By the way, which version of IE are you using? |
I think I tried it with both IE9 and IE8 (flash enabled: works; flash disabled: doesn't) through browserstack.com |
Could you tell me which version of the Pusher JavaScript library you are using? Also, are there any error messages displayed in your browser console? |
Sorry. Another question: when do you bind to the |
Hi, I use CoffeeScript and have a static object that holds a method to start listening to different pusher events. @CarHistoryLookupForm =
messages_received: 0
received_anything: false
pusher: null
channel: null
start_listening: (channel_id) ->
@pusher = new Pusher('xxxxxxx')
@pusher.connection.bind 'failed', @unsupported
@channel = @pusher.subscribe(channel_id)
@channel.bind 'start', (data) => @handle_start(data)
@channel.bind 'success', (data) => @handle_succes(data)
@channel.bind 'failure', (data) => @handle_failure(data)
@channel.bind 'failure_unknown_reg_number', (data) => @handle_reg_number_failure(data)
# ....
handle_failure: (data={}) ->
@disconnect_pusher
@hide_loader()
@show_failure()
I call the method from an AJAX response that gets executed (Rails remote form) CarHistoryLookupForm.start_listening('<%=@channel%>') if you're not familiar with CoffeeScript, please note that |
Great - thank you. Which version of the Pusher JavaScript library are you on? |
I was using this one: "http://js.pusher.com/1.11/pusher.min.js" |
Great - thank you. I'll be in touch after I've investigated further. |
Hmm. I'm a bit baffled. I tried a test with the following code:
in IE8 running both on a local VM and in browserstack.com and the Thanks. |
As we agreed via email, I'm going to close this because we can't reproduce it in isolation from your app. |
Hello! I have exactly the same problem. I can read in docs (https://pusher.com/docs/client_api_guide/client_connect) I should bind 'error' So I do the following:
And when I connect / disconnect my internet connection the only console log I can see is "Pusher's current state is ...". Should I do something else? Thanks in advance! |
From https://pusher.com/docs/client_api_guide/client_connect: A state of
This will only every happy at the very start of the connection/ A state of
Additionally, this may happen if you provide the incorrect application key. This also only happens at the very start of the connection/
As above, this is because both I hope this clarifies things. |
When I test my application in IE with flash disabled, the 'failed' connection state is not triggered, which doesn't allow me to display a sympathy message for my users that don't have Flash (or wrong version) or WebSockets.
The code I was using at the beginning is this:
And when I was trying to debug a little further I tried to bind the 'state_change' event:
Which does what is suppose in Safari or IE with Flash but doesn't output anything in IE without Flash.
Does anyone have a working example that the 'failed' state is triggered?
The text was updated successfully, but these errors were encountered: