jsperf.com icon indicating copy to clipboard operation
jsperf.com copied to clipboard

Test case named "search" exists, interferes with search functionality

Open AjaxGb opened this issue 6 years ago • 1 comments

Apparently, the user @bkfarnsworth created a perfectly normal test case in November 2018, and happened to name it "search". This caused it to overlap with the https://jsperf.com/search page, so no matter what you enter in the search bar it takes you to bk's test case instead of a results page.

Additionally, entering the query into the URL manually (as in https://jsperf.com/search?q=example) just displays "something went wrong". I suspect this may be related.

Creating test cases that share a name with built-in site URLs should not be allowed.

AjaxGb avatar Jan 24 '19 00:01 AjaxGb

Creating test cases that share a name with built-in site URLs should not be allowed.

Here is where we check if a slug is available. Here is where we check against registered routes with the server. Here is the relevant Hapi documentation. Here is the existing unit test. Here is where the search route is declared.

If the attempted slug is "search" but the registered path is "/search{ext?}", then path.substr(1) === slug won't be true and a page will be registered with a generic collision.

I don't have time to fix this. As a workaround, you could search Google with site:jsperf.com like this.

maxbeatty avatar Jan 24 '19 07:01 maxbeatty