{"action":"created","issue":{"url":"https://api.github.com/repos/highfidelity/hifi/issues/14463","repository_url":"https://api.github.com/repos/highfidelity/hifi","labels_url":"https://api.github.com/repos/highfidelity/hifi/issues/14463/labels{/name}","comments_url":"https://api.github.com/repos/highfidelity/hifi/issues/14463/comments","events_url":"https://api.github.com/repos/highfidelity/hifi/issues/14463/events","html_url":"https://github.com/highfidelity/hifi/pull/14463","id":383622996,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMDQ4MzA3","number":14463,"title":"Pause scripting engine when interface is not active (MS 19379)","user":{"login":"gcalero","id":5520613,"node_id":"MDQ6VXNlcjU1MjA2MTM=","avatar_url":"https://avatars0.githubusercontent.com/u/5520613?v=4","gravatar_id":"","url":"https://api.github.com/users/gcalero","html_url":"https://github.com/gcalero","followers_url":"https://api.github.com/users/gcalero/followers","following_url":"https://api.github.com/users/gcalero/following{/other_user}","gists_url":"https://api.github.com/users/gcalero/gists{/gist_id}","starred_url":"https://api.github.com/users/gcalero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcalero/subscriptions","organizations_url":"https://api.github.com/users/gcalero/orgs","repos_url":"https://api.github.com/users/gcalero/repos","events_url":"https://api.github.com/users/gcalero/events{/privacy}","received_events_url":"https://api.github.com/users/gcalero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-11-22T17:45:43Z","updated_at":"2018-11-22T20:55:43Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/14463","html_url":"https://github.com/highfidelity/hifi/pull/14463","diff_url":"https://github.com/highfidelity/hifi/pull/14463.diff","patch_url":"https://github.com/highfidelity/hifi/pull/14463.patch"},"body":"When the app is in background i.e. when you press home button we have 2-3 separate threads still executing the scripting engine as well as js.Entities. These are contributing to battery drainage and some minor but performance issues.\r\n\r\nThis PR stops scripting engines when the app goes to background.\r\n\r\n**Testing plan**\r\n-  All scripts have to start normally when Interface starts and you enter a domain\r\n- Script threads must be stopped when app goes to background (i.e. by pressing home button)\r\n- Scripts must be restarted when the app goes to foreground\r\n- When the app goes back to foreground, search for script errors in logs\r\n\r\nYou can open \"Android Profiler\" tab in Android Studio and then clic on the CPU chart to see the threads list. Notice that when the app comes back to foreground a new thread/row is created\r\n\r\nhttps://highfidelity.manuscript.com/f/filters/94/My-Cases"},"comment":{"url":"https://api.github.com/repos/highfidelity/hifi/issues/comments/441118826","html_url":"https://github.com/highfidelity/hifi/pull/14463#issuecomment-441118826","issue_url":"https://api.github.com/repos/highfidelity/hifi/issues/14463","id":441118826,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTExODgyNg==","user":{"login":"hifi-gustavo","id":4554450,"node_id":"MDQ6VXNlcjQ1NTQ0NTA=","avatar_url":"https://avatars0.githubusercontent.com/u/4554450?v=4","gravatar_id":"","url":"https://api.github.com/users/hifi-gustavo","html_url":"https://github.com/hifi-gustavo","followers_url":"https://api.github.com/users/hifi-gustavo/followers","following_url":"https://api.github.com/users/hifi-gustavo/following{/other_user}","gists_url":"https://api.github.com/users/hifi-gustavo/gists{/gist_id}","starred_url":"https://api.github.com/users/hifi-gustavo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hifi-gustavo/subscriptions","organizations_url":"https://api.github.com/users/hifi-gustavo/orgs","repos_url":"https://api.github.com/users/hifi-gustavo/repos","events_url":"https://api.github.com/users/hifi-gustavo/events{/privacy}","received_events_url":"https://api.github.com/users/hifi-gustavo/received_events","type":"User","site_admin":false},"created_at":"2018-11-22T20:55:43Z","updated_at":"2018-11-22T20:55:43Z","author_association":"NONE","body":"Android build is available at: https://deployment.highfidelity.com/jobs/pr-build/label%3Dandroid/15348/HighFidelity-Beta-PR14463-9ab109f.apk"}}
{"actor":{"display_login":"hifi-gustavo"}}