{"action":"closed","number":711,"pull_request":{"url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/711","id":91752949,"html_url":"https://github.com/HangfireIO/Hangfire/pull/711","diff_url":"https://github.com/HangfireIO/Hangfire/pull/711.diff","patch_url":"https://github.com/HangfireIO/Hangfire/pull/711.patch","issue_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/711","number":711,"state":"closed","locked":false,"title":"Window resize cause errors and uncontrolled growth of event and poll listeners","user":{"login":"Yarmonov","id":1964984,"avatar_url":"https://avatars.githubusercontent.com/u/1964984?v=3","gravatar_id":"","url":"https://api.github.com/users/Yarmonov","html_url":"https://github.com/Yarmonov","followers_url":"https://api.github.com/users/Yarmonov/followers","following_url":"https://api.github.com/users/Yarmonov/following{/other_user}","gists_url":"https://api.github.com/users/Yarmonov/gists{/gist_id}","starred_url":"https://api.github.com/users/Yarmonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yarmonov/subscriptions","organizations_url":"https://api.github.com/users/Yarmonov/orgs","repos_url":"https://api.github.com/users/Yarmonov/repos","events_url":"https://api.github.com/users/Yarmonov/events{/privacy}","received_events_url":"https://api.github.com/users/Yarmonov/received_events","type":"User","site_admin":false},"body":"## Preamble\r\n\r\nIn the ongoing project I was integrating Hangfire dashboard into the existing UI using simple iframe approach. To auto-size the iframe I used custom resizing handler and noticed that Hangfire throws a lot of exceptions.\r\n\r\n## Steps to reproduce\r\n\r\n1. Execute MvcSample and navigate to /hangfire URL (Chrome, Firefox, IE - all are affected).\r\n2. Open browser's developer console.\r\n3. Resize the window.\r\n4. Move mouse over graphs on the dashboard.\r\n5. Each mouse movement event will throw \"Uncaught TypeError: Cannot read property 'getBoundingClientRect' of null(…)\".\r\n6. The same exception will be also thrown periodically, event without mouse moving.\r\n\r\n## Problem\r\n\r\nIn the window.onresize handler (hangfire.js:221) existing graphs placeholders are emptied and new graphs created. During the creation phase, Rickshaw.Graph.HoverDetail adds listeners for mousemove and mouseout events of the graph placeholder. But it is just emptied, so on resize these listeners aren't removed and still exists. Therefor each resize adds 2 new listeners. Besides this listeners growth the old ones are working with detached nodes those and this causes an error mentioned above.\r\n\r\nAnother problem is caused by statistics poller. When realtim graph is created, it adds a listener. But when recreated during resize old listener is not removed, but new one is added.\r\n\r\n## Solution\r\n\r\n1. I have added graph placeholder node recreation, This removes obsolete handlers from it,\r\n2. Instead of calling _createGraphs, I'm calling new Hangfire.Page creation. It calls _createGraphs and also recreate poller. So this removes obsolete poller listeners.\r\n3. Slight fix in _createRealtimeGraph. It has a condition if placeholder exists, but not all code that manipulate with the placeholder is inside of this condition (just compare to _createHistoryGraph that has a proper wrap).","created_at":"2016-11-01T09:21:16Z","updated_at":"2016-11-21T09:21:05Z","closed_at":"2016-11-21T09:21:05Z","merged_at":"2016-11-21T09:21:05Z","merge_commit_sha":"aef0096307eb7fd9c1684297bb1017e6e4d45275","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/HangfireIO/Hangfire/milestones/52","html_url":"https://github.com/HangfireIO/Hangfire/milestones/1.6.7","labels_url":"https://api.github.com/repos/HangfireIO/Hangfire/milestones/52/labels","id":2092837,"number":52,"title":"1.6.7","description":"","creator":{"login":"odinserj","id":1078718,"avatar_url":"https://avatars.githubusercontent.com/u/1078718?v=3","gravatar_id":"","url":"https://api.github.com/users/odinserj","html_url":"https://github.com/odinserj","followers_url":"https://api.github.com/users/odinserj/followers","following_url":"https://api.github.com/users/odinserj/following{/other_user}","gists_url":"https://api.github.com/users/odinserj/gists{/gist_id}","starred_url":"https://api.github.com/users/odinserj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odinserj/subscriptions","organizations_url":"https://api.github.com/users/odinserj/orgs","repos_url":"https://api.github.com/users/odinserj/repos","events_url":"https://api.github.com/users/odinserj/events{/privacy}","received_events_url":"https://api.github.com/users/odinserj/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":17,"state":"open","created_at":"2016-10-25T17:16:07Z","updated_at":"2016-11-21T09:21:05Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/711/commits","review_comments_url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/711/comments","review_comment_url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/711/comments","statuses_url":"https://api.github.com/repos/HangfireIO/Hangfire/statuses/f5fe3a29605874a760b7ba52811515ae4d7ae39d","head":{"label":"Yarmonov:fix-dashboard-resize","ref":"fix-dashboard-resize","sha":"f5fe3a29605874a760b7ba52811515ae4d7ae39d","user":{"login":"Yarmonov","id":1964984,"avatar_url":"https://avatars.githubusercontent.com/u/1964984?v=3","gravatar_id":"","url":"https://api.github.com/users/Yarmonov","html_url":"https://github.com/Yarmonov","followers_url":"https://api.github.com/users/Yarmonov/followers","following_url":"https://api.github.com/users/Yarmonov/following{/other_user}","gists_url":"https://api.github.com/users/Yarmonov/gists{/gist_id}","starred_url":"https://api.github.com/users/Yarmonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yarmonov/subscriptions","organizations_url":"https://api.github.com/users/Yarmonov/orgs","repos_url":"https://api.github.com/users/Yarmonov/repos","events_url":"https://api.github.com/users/Yarmonov/events{/privacy}","received_events_url":"https://api.github.com/users/Yarmonov/received_events","type":"User","site_admin":false},"repo":{"id":72472267,"name":"Hangfire","full_name":"Yarmonov/Hangfire","owner":{"login":"Yarmonov","id":1964984,"avatar_url":"https://avatars.githubusercontent.com/u/1964984?v=3","gravatar_id":"","url":"https://api.github.com/users/Yarmonov","html_url":"https://github.com/Yarmonov","followers_url":"https://api.github.com/users/Yarmonov/followers","following_url":"https://api.github.com/users/Yarmonov/following{/other_user}","gists_url":"https://api.github.com/users/Yarmonov/gists{/gist_id}","starred_url":"https://api.github.com/users/Yarmonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yarmonov/subscriptions","organizations_url":"https://api.github.com/users/Yarmonov/orgs","repos_url":"https://api.github.com/users/Yarmonov/repos","events_url":"https://api.github.com/users/Yarmonov/events{/privacy}","received_events_url":"https://api.github.com/users/Yarmonov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Yarmonov/Hangfire","description":"An easy way to perform background processing in your .NET and .NET Core applications","fork":true,"url":"https://api.github.com/repos/Yarmonov/Hangfire","forks_url":"https://api.github.com/repos/Yarmonov/Hangfire/forks","keys_url":"https://api.github.com/repos/Yarmonov/Hangfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yarmonov/Hangfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yarmonov/Hangfire/teams","hooks_url":"https://api.github.com/repos/Yarmonov/Hangfire/hooks","issue_events_url":"https://api.github.com/repos/Yarmonov/Hangfire/issues/events{/number}","events_url":"https://api.github.com/repos/Yarmonov/Hangfire/events","assignees_url":"https://api.github.com/repos/Yarmonov/Hangfire/assignees{/user}","branches_url":"https://api.github.com/repos/Yarmonov/Hangfire/branches{/branch}","tags_url":"https://api.github.com/repos/Yarmonov/Hangfire/tags","blobs_url":"https://api.github.com/repos/Yarmonov/Hangfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yarmonov/Hangfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yarmonov/Hangfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yarmonov/Hangfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yarmonov/Hangfire/statuses/{sha}","languages_url":"https://api.github.com/repos/Yarmonov/Hangfire/languages","stargazers_url":"https://api.github.com/repos/Yarmonov/Hangfire/stargazers","contributors_url":"https://api.github.com/repos/Yarmonov/Hangfire/contributors","subscribers_url":"https://api.github.com/repos/Yarmonov/Hangfire/subscribers","subscription_url":"https://api.github.com/repos/Yarmonov/Hangfire/subscription","commits_url":"https://api.github.com/repos/Yarmonov/Hangfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yarmonov/Hangfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yarmonov/Hangfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yarmonov/Hangfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yarmonov/Hangfire/contents/{+path}","compare_url":"https://api.github.com/repos/Yarmonov/Hangfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yarmonov/Hangfire/merges","archive_url":"https://api.github.com/repos/Yarmonov/Hangfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yarmonov/Hangfire/downloads","issues_url":"https://api.github.com/repos/Yarmonov/Hangfire/issues{/number}","pulls_url":"https://api.github.com/repos/Yarmonov/Hangfire/pulls{/number}","milestones_url":"https://api.github.com/repos/Yarmonov/Hangfire/milestones{/number}","notifications_url":"https://api.github.com/repos/Yarmonov/Hangfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yarmonov/Hangfire/labels{/name}","releases_url":"https://api.github.com/repos/Yarmonov/Hangfire/releases{/id}","deployments_url":"https://api.github.com/repos/Yarmonov/Hangfire/deployments","created_at":"2016-10-31T19:48:28Z","updated_at":"2016-10-31T19:48:30Z","pushed_at":"2016-11-20T10:56:55Z","git_url":"git://github.com/Yarmonov/Hangfire.git","ssh_url":"git@github.com:Yarmonov/Hangfire.git","clone_url":"https://github.com/Yarmonov/Hangfire.git","svn_url":"https://github.com/Yarmonov/Hangfire","homepage":"http://hangfire.io","size":25284,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"HangfireIO:master","ref":"master","sha":"4207d297d46128a727184bacab929447475641bb","user":{"login":"HangfireIO","id":7880472,"avatar_url":"https://avatars.githubusercontent.com/u/7880472?v=3","gravatar_id":"","url":"https://api.github.com/users/HangfireIO","html_url":"https://github.com/HangfireIO","followers_url":"https://api.github.com/users/HangfireIO/followers","following_url":"https://api.github.com/users/HangfireIO/following{/other_user}","gists_url":"https://api.github.com/users/HangfireIO/gists{/gist_id}","starred_url":"https://api.github.com/users/HangfireIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HangfireIO/subscriptions","organizations_url":"https://api.github.com/users/HangfireIO/orgs","repos_url":"https://api.github.com/users/HangfireIO/repos","events_url":"https://api.github.com/users/HangfireIO/events{/privacy}","received_events_url":"https://api.github.com/users/HangfireIO/received_events","type":"Organization","site_admin":false},"repo":{"id":11920542,"name":"Hangfire","full_name":"HangfireIO/Hangfire","owner":{"login":"HangfireIO","id":7880472,"avatar_url":"https://avatars.githubusercontent.com/u/7880472?v=3","gravatar_id":"","url":"https://api.github.com/users/HangfireIO","html_url":"https://github.com/HangfireIO","followers_url":"https://api.github.com/users/HangfireIO/followers","following_url":"https://api.github.com/users/HangfireIO/following{/other_user}","gists_url":"https://api.github.com/users/HangfireIO/gists{/gist_id}","starred_url":"https://api.github.com/users/HangfireIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HangfireIO/subscriptions","organizations_url":"https://api.github.com/users/HangfireIO/orgs","repos_url":"https://api.github.com/users/HangfireIO/repos","events_url":"https://api.github.com/users/HangfireIO/events{/privacy}","received_events_url":"https://api.github.com/users/HangfireIO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HangfireIO/Hangfire","description":"An easy way to perform background processing in your .NET and .NET Core applications","fork":false,"url":"https://api.github.com/repos/HangfireIO/Hangfire","forks_url":"https://api.github.com/repos/HangfireIO/Hangfire/forks","keys_url":"https://api.github.com/repos/HangfireIO/Hangfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HangfireIO/Hangfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HangfireIO/Hangfire/teams","hooks_url":"https://api.github.com/repos/HangfireIO/Hangfire/hooks","issue_events_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/events{/number}","events_url":"https://api.github.com/repos/HangfireIO/Hangfire/events","assignees_url":"https://api.github.com/repos/HangfireIO/Hangfire/assignees{/user}","branches_url":"https://api.github.com/repos/HangfireIO/Hangfire/branches{/branch}","tags_url":"https://api.github.com/repos/HangfireIO/Hangfire/tags","blobs_url":"https://api.github.com/repos/HangfireIO/Hangfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HangfireIO/Hangfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HangfireIO/Hangfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/HangfireIO/Hangfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HangfireIO/Hangfire/statuses/{sha}","languages_url":"https://api.github.com/repos/HangfireIO/Hangfire/languages","stargazers_url":"https://api.github.com/repos/HangfireIO/Hangfire/stargazers","contributors_url":"https://api.github.com/repos/HangfireIO/Hangfire/contributors","subscribers_url":"https://api.github.com/repos/HangfireIO/Hangfire/subscribers","subscription_url":"https://api.github.com/repos/HangfireIO/Hangfire/subscription","commits_url":"https://api.github.com/repos/HangfireIO/Hangfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/HangfireIO/Hangfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/HangfireIO/Hangfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/HangfireIO/Hangfire/contents/{+path}","compare_url":"https://api.github.com/repos/HangfireIO/Hangfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HangfireIO/Hangfire/merges","archive_url":"https://api.github.com/repos/HangfireIO/Hangfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HangfireIO/Hangfire/downloads","issues_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues{/number}","pulls_url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls{/number}","milestones_url":"https://api.github.com/repos/HangfireIO/Hangfire/milestones{/number}","notifications_url":"https://api.github.com/repos/HangfireIO/Hangfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HangfireIO/Hangfire/labels{/name}","releases_url":"https://api.github.com/repos/HangfireIO/Hangfire/releases{/id}","deployments_url":"https://api.github.com/repos/HangfireIO/Hangfire/deployments","created_at":"2013-08-06T09:43:04Z","updated_at":"2016-11-20T20:27:58Z","pushed_at":"2016-11-21T09:21:05Z","git_url":"git://github.com/HangfireIO/Hangfire.git","ssh_url":"git@github.com:HangfireIO/Hangfire.git","clone_url":"https://github.com/HangfireIO/Hangfire.git","svn_url":"https://github.com/HangfireIO/Hangfire","homepage":"http://hangfire.io","size":28870,"stargazers_count":2100,"watchers_count":2100,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":575,"mirror_url":null,"open_issues_count":158,"forks":575,"open_issues":158,"watchers":2100,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/711"},"html":{"href":"https://github.com/HangfireIO/Hangfire/pull/711"},"issue":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/issues/711"},"comments":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/issues/711/comments"},"review_comments":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/711/comments"},"review_comment":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/711/commits"},"statuses":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/statuses/f5fe3a29605874a760b7ba52811515ae4d7ae39d"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"odinserj","id":1078718,"avatar_url":"https://avatars.githubusercontent.com/u/1078718?v=3","gravatar_id":"","url":"https://api.github.com/users/odinserj","html_url":"https://github.com/odinserj","followers_url":"https://api.github.com/users/odinserj/followers","following_url":"https://api.github.com/users/odinserj/following{/other_user}","gists_url":"https://api.github.com/users/odinserj/gists{/gist_id}","starred_url":"https://api.github.com/users/odinserj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odinserj/subscriptions","organizations_url":"https://api.github.com/users/odinserj/orgs","repos_url":"https://api.github.com/users/odinserj/repos","events_url":"https://api.github.com/users/odinserj/events{/privacy}","received_events_url":"https://api.github.com/users/odinserj/received_events","type":"User","site_admin":false},"comments":8,"review_comments":0,"commits":4,"additions":65,"deletions":65,"changed_files":1}}
{"actor":{"display_login":"odinserj"}}