Skip to content
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

Setting request shared attribute to true causes JavaScript errors in Firefox, IE, and Safari #1102

Closed
hkykid opened this issue May 23, 2013 · 4 comments

Comments

@hkykid
Copy link

hkykid commented May 23, 2013

Using Atmosphere version 1.0.13 and the jquery.atmosphere.js file, setting the shared attribute on the request leads to two different JavaScript errors in IE and Firefox.

For the following two errors, I was able to verify that only one connection was being created regardless of the amount of tabs that I opened. However, messages were not being shared across tabs.

It also appears that only the page that initially opens the connection is able to receive the push messages. Other tabs that are opened do not receive updates and the onLocalMessage callback is no invoked.

The following are the errors I was able to find.

IE Error (Tested with versions 8, 9, 10)

  • Received a permission denied error at line 597 of jquery.atmosphere.js
  • Error occurred when a push from the server was initiated.
  • Side note: I tried turning my privacy settings on IE to none (obvisouly not desired) and error still occurred

Firefox Error (Firefox 20)

  • Received the following error at line 382 of the same file.
    TypeError: get(...) is null
    set("children", get("children").concat([guid]));
    • Error seemed to occur when the socket connection is first made/created.

In Chrome, it seems that some of the functionality works. I was able to load my site on two tabs and get them to exchange data across tabs. However, functionality did not work the first few times when the tabs to my site were initially created. (I apologize for not being more specific but I am unsure whether my clicking on one tab/refreshing that tab and then performing the same actions on the next page were what got both tabs finally in sync to receive push updates on both). I could not produce any JavaScript errors.

In Safari, I receive the same error as Firefox at line 382
TypeError: 'null' is not an object (evaluating 'get("children").concat')

I can include some of the js code if desired, but I am not including it here because it is really that that different than what is listed here (https://github.com/Atmosphere/atmosphere/wiki/Sharing-connection-between-Browser%27s-windows-and-tabs).

@hkykid hkykid closed this as completed May 29, 2013
@hkykid hkykid reopened this May 29, 2013
@flowersinthesand
Copy link
Member

I'll look at this. Just make to sure what's your jquery, jquery.atmopshere and os version? If you can provide a test case as a war or a maven project, it would be very nice.

@flowersinthesand
Copy link
Member

It also appears that only the page that initially opens the connection is able to receive the push messages. Other tabs that are opened do not receive updates and the onLocalMessage callback is no invoked.

onLocalMessage is fired by pushLocal method. You need to execute that method with string data explicitly maybe in onMessage callback and with response.responseBody property.

Received a permission denied error at line 597 of jquery.atmosphere.js

This may be related to https://github.com/flowersinthesand/portal/wiki/Browser-Quirks#a-blank-page-pops-up-when-there-is-a-shared-connection But, the current source's 597 line indicates something wrong. I'm not sure.

The problem I find is that when the master connection dies, all the slaves are trying to make the real connection. Originally, the one called 'heir' do that and the others connects to the real connection made by the heir after 100ms. However, it seems that this is broken. By any chance, did you experience this as well?

@hkykid
Copy link
Author

hkykid commented Sep 13, 2013

Atmosphere Version = 1.0.13
jQuery.atmosphere version = 1.0.13
jQuery version = 1.8.1
OS = Mac OS X 10.7.5 (Running parallels with Windows 7 64-bit). I was attempting to use the shared connection with IE 8/9 running on the Windows 7 virtual machine.

onLocalMessage is fired by pushLocal method. You need to execute that method with string data explicitly maybe in onMessage callback and with response.responseBody property.

I did have a pushLocal call within the method that was my onMessage callback

This may be related to https://github.com/flowersinthesand/portal/wiki/Browser-Quirks#a-blank-page-pops-up-when-there-is-a-shared-connection But, the current source's 597 line indicates something wrong.

No, the page rendered fine but the page just did not update/receive any local push messages.

@flowersinthesand
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants