{"action":"created","issue":{"url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1854","labels_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1854/labels{/name}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1854/comments","events_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1854/events","html_url":"https://github.com/jenkinsci/jenkins/pull/1854","id":109870860,"number":1854,"title":"[JENKINS-21720] JS alert preventing to leave a configuration page without changes","user":{"login":"amuniz","id":1017585,"avatar_url":"https://avatars.githubusercontent.com/u/1017585?v=3","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-10-05T19:39:51Z","updated_at":"2015-10-06T08:37:13Z","closed_at":"2015-10-06T08:08:41Z","pull_request":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1854","html_url":"https://github.com/jenkinsci/jenkins/pull/1854","diff_url":"https://github.com/jenkinsci/jenkins/pull/1854.diff","patch_url":"https://github.com/jenkinsci/jenkins/pull/1854.patch"},"body":"[JENKINS-21720](https://issues.jenkins-ci.org/browse/JENKINS-21720) reopened.\r\n\r\nThe JS alert is being shown when it must not and it's [producing fails in ATH](https://jenkins.ci.cloudbees.com/job/core/job/acceptance-test-harness/1246/testReport/junit/core/BuildHistoryTest/view_build_history).\r\n\r\n`<select>` tags have a default behavior in Jenkins which is to select the first option if there is no value stored for it, but initially (before to call any AJAX endpoint to retrieve data) the default value for the `<select>` is `\"\"`, then the first value coming in the AJAX request is set as default, and this value is not `\"\"` (empty string) but `0`, `1` or whatever. So after setting the value a change is detected and the JS shown when leaving the page.\r\n\r\nThe original fix was to delay 100 ms to start monitoring for changes in the formulary. This workaround was really hiding to underlying issue. Under high load circumstances some HTTP requests (made to load `<select>` options) surpasses this time limit, which leads on triggering the \"change\" event when there was no real changes.\r\n\r\n@reviewbybees"},"comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/issues/comments/145783697","html_url":"https://github.com/jenkinsci/jenkins/pull/1854#issuecomment-145783697","issue_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1854","id":145783697,"user":{"login":"amuniz","id":1017585,"avatar_url":"https://avatars.githubusercontent.com/u/1017585?v=3","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T08:37:13Z","updated_at":"2015-10-06T08:37:13Z","body":"@oleg-nenashev Do you think this could be considered to be included in 1.625 LTS?"}}