{"action":"created","issue":{"url":"https://api.github.com/repos/arqex/freezer/issues/114","repository_url":"https://api.github.com/repos/arqex/freezer","labels_url":"https://api.github.com/repos/arqex/freezer/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/arqex/freezer/issues/114/comments","events_url":"https://api.github.com/repos/arqex/freezer/issues/114/events","html_url":"https://github.com/arqex/freezer/issues/114","id":343811306,"node_id":"MDU6SXNzdWUzNDM4MTEzMDY=","number":114,"title":"MS Edge compatibility issue with processQueue()","user":{"login":"corinnaSchultz","id":8988264,"node_id":"MDQ6VXNlcjg5ODgyNjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8988264?v=4","gravatar_id":"","url":"https://api.github.com/users/corinnaSchultz","html_url":"https://github.com/corinnaSchultz","followers_url":"https://api.github.com/users/corinnaSchultz/followers","following_url":"https://api.github.com/users/corinnaSchultz/following{/other_user}","gists_url":"https://api.github.com/users/corinnaSchultz/gists{/gist_id}","starred_url":"https://api.github.com/users/corinnaSchultz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corinnaSchultz/subscriptions","organizations_url":"https://api.github.com/users/corinnaSchultz/orgs","repos_url":"https://api.github.com/users/corinnaSchultz/repos","events_url":"https://api.github.com/users/corinnaSchultz/events{/privacy}","received_events_url":"https://api.github.com/users/corinnaSchultz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-23T21:59:42Z","updated_at":"2018-08-02T17:38:40Z","closed_at":null,"author_association":"NONE","body":"This is a little hard to reproduce, and I think there is an issue with how Edge handles iframes. We have no problem with this same app in Chrome or Safari or Firefox.\r\n\r\nWhat I have observed is that when my app loads for the first time, in a fresh tab (disabling the cache in the devtools doesn't work, this needs to be a fresh tab), the first event object that is passed into processQueue results in the boolean event.source === global returning false.\r\n\r\nI have seen this false value come from two different causes:\r\n1) The event is a \"load\" event and not a \"message\" event. In the course of my debugging, I only saw this a couple of times, so I think there may be a race condition in the way the processQueue function is called.\r\n\r\n2)  Much more common, what I observed is that when the page loaded, the event.source was the \"main\" window, and global was the iframe window object. I don't know what it is about how my app loads that causes the window objects to be different sometimes, and the same other times. This code seems to be hit three times during load, and only the first time are the window objects different.\r\n\r\nSomething about the false value is causing the rest of my app not to work, possibly because the queue never gets flushed?\r\n\r\nIf I change the code so that flushQueue() is called outside the if statement, then things seem to work ok (I am just beginning browser testing with Edge, so it's possible I'll find other issues).\r\n\r\n```\r\nprocessQueue = (function () {\r\n   return hasPostMessage\r\n\t? function processQueue (event) {\r\n\t      if (event.source === global && event.data === messageName) {\r\n\t\t  event.stopPropagation();\r\n\t      }\r\n              flushQueue();   // THIS IS THE LINE I MOVED\r\n         }\r\n       : flushQueue;\r\n})()\r\n```\r\n\r\nI am reluctant to submit this as a Pull Request, because I'm not sure if there are any negative consequences to making this change.  I'd appreciate it if you/someone could review this."},"comment":{"url":"https://api.github.com/repos/arqex/freezer/issues/comments/410008833","html_url":"https://github.com/arqex/freezer/issues/114#issuecomment-410008833","issue_url":"https://api.github.com/repos/arqex/freezer/issues/114","id":410008833,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDAwODgzMw==","user":{"login":"arqex","id":6509397,"node_id":"MDQ6VXNlcjY1MDkzOTc=","avatar_url":"https://avatars2.githubusercontent.com/u/6509397?v=4","gravatar_id":"","url":"https://api.github.com/users/arqex","html_url":"https://github.com/arqex","followers_url":"https://api.github.com/users/arqex/followers","following_url":"https://api.github.com/users/arqex/following{/other_user}","gists_url":"https://api.github.com/users/arqex/gists{/gist_id}","starred_url":"https://api.github.com/users/arqex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arqex/subscriptions","organizations_url":"https://api.github.com/users/arqex/orgs","repos_url":"https://api.github.com/users/arqex/repos","events_url":"https://api.github.com/users/arqex/events{/privacy}","received_events_url":"https://api.github.com/users/arqex/received_events","type":"User","site_admin":false},"created_at":"2018-08-02T17:38:40Z","updated_at":"2018-08-02T17:38:40Z","author_association":"OWNER","body":"I have just published a new version that it's not using `event.source` anymore to check what's the origin of the message. Let me know if it fixed your issue."}}
{"actor":{"display_login":"arqex"}}