2 edited tags
| link
1
source | link

Careers Candidate Search is Relentless

When using the Careers candidate search, the client-side code refuses to believe that changes to (at least) your Skills search criteria will be fruitless, and continuously double-checks with the server for results. While I appreciate its enthusiasm, the requests are excessive at around 6 per second:

Network request log showing excessive requests

You can test this by going to the search page and putting in either an unpopular tag, or one that doesn't exist, like "ja". I was able to reproduce this in Firefox 3.6, Chrome 11 and 13, IE 9 (for good measure), and Opera 11 (for Jeff's amusement).

A quick look at the code suggests that the problem might be in the SearchResultsView.render function, where this.model.attributes.CurrentPage is set to -1 when a zero-result response is returned. This causes Search.LoadPage() to be called later on, which I believe makes the search request again, and this request is handled by SearchResultsView.render. Provided this is correct, it seems that this leads to a loop so long as the response doesn't have any candidates to display.