{"action":"closed","issue":{"url":"https://api.github.com/repos/jzaefferer/jquery-validation/issues/723","labels_url":"https://api.github.com/repos/jzaefferer/jquery-validation/issues/723/labels{/name}","comments_url":"https://api.github.com/repos/jzaefferer/jquery-validation/issues/723/comments","events_url":"https://api.github.com/repos/jzaefferer/jquery-validation/issues/723/events","html_url":"https://github.com/jzaefferer/jquery-validation/issues/723","id":13180274,"number":723,"title":"Remote validation calls showErrors before clearing up","user":{"login":"matthewvalimaki","id":1033909,"avatar_url":"https://avatars.githubusercontent.com/u/1033909?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewvalimaki","html_url":"https://github.com/matthewvalimaki","followers_url":"https://api.github.com/users/matthewvalimaki/followers","following_url":"https://api.github.com/users/matthewvalimaki/following{/other_user}","gists_url":"https://api.github.com/users/matthewvalimaki/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewvalimaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewvalimaki/subscriptions","organizations_url":"https://api.github.com/users/matthewvalimaki/orgs","repos_url":"https://api.github.com/users/matthewvalimaki/repos","events_url":"https://api.github.com/users/matthewvalimaki/events{/privacy}","received_events_url":"https://api.github.com/users/matthewvalimaki/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2013-04-14T22:55:40Z","updated_at":"2015-06-26T16:37:09Z","closed_at":"2015-06-26T16:37:09Z","body":"In remote validation we have a success callback and at the very bottom of the callback we have\r\n\r\n```javascript\r\nprevious.valid = valid;\r\nvalidator.stopRequest(element, valid);\r\n```\r\n\r\nI believe those two lines should go right above\r\n\r\n```javascript\r\nif ( valid ) {\r\n...\r\n} else {\r\n...\r\n}\r\n```\r\n\r\nReasoning for this change is the fact, that within if-else clause we call showErrors() while validator.pending still has the element and pending status is > 0. If in showErrors() we want to know before showing errors if the element is still pending remote validation, we will get an incorrect status."}}