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

check for a valid iframe.contentWindow inside the timeout call #246

Closed

Conversation

sgellock
Copy link

address a possible race condition where the call to the iframe's postMessage can happen after the frame has been closed. The initial check can succeed, but the call happens 'later' and it is possible for the frame to be closed.

address a possible race condition where the call to the iframe's postMessage can happen after the frame has been closed.  The initial check can succeed, but the call happens 'later' and it is possible for the frame to be closed.
@brycekahle
Copy link
Contributor

Seems like the outside if statement isn't really needed anymore. Want to remove that?

@brycekahle
Copy link
Contributor

I would also love it if you can add a test that exposes this bug.

@sgellock
Copy link
Author

removing the outer if statement was something I pondered. So yes. Let me clean that up. Regarding a test, happy to do that too. This is a timing issue. Is there a similar test that I could look at for guidance?

@brycekahle
Copy link
Contributor

I don't think there are good examples of tests that expose timing issues. I'm happy to help if you get stuck.

@tomfisher
Copy link

The race condition happens in my project unfortunately after updating to version 1.0 from 0.3.4. It happened when the connection failed and its calling stack can be found at http://pasteboard.co/19Su0QWU.png

@tomfisher
Copy link

That just happened just when the web-socket handshaking failed

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

Successfully merging this pull request may close these issues.

3 participants