Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search is broken #1023

Closed
adamopenweb opened this issue Apr 28, 2016 · 11 comments
Closed

Search is broken #1023

adamopenweb opened this issue Apr 28, 2016 · 11 comments
Assignees

Comments

@adamopenweb
Copy link
Collaborator

adamopenweb commented Apr 28, 2016

Looks like search is broken.
STR:

  • Navigate to webcompat.com
  • Click and type 'video'
  • Click View All Open Issues and switch to View All Issues

Expected Results:
Display related bugs

Actual Results:
Error: "Not Found. Lost in Punk Cat Space"

Also navigating direct to this link doesn't work: https://webcompat.com/issues?page=1&per_page=50&state=open&stage=all&sort=created&direction=desc&q=%22country%3A+jp%22

@hallvors
Copy link
Contributor

hallvors commented May 2, 2016

IMHO this is a side effect of #795 - the site does not allow you filter by various separate options right now. You can't both give a search word and a bug state, for example. The bugs #795 and #863 are about fixing that but my attempts so far were not solid enough.

(While I think it could be closed as a dup, I guess it will take time to fix those issues so we should perhaps add a workaround here)

@miketaylr
Copy link
Member

I don't think this is a dupe, this used to work.

@miketaylr
Copy link
Member

miketaylr commented May 31, 2016

I think this bug is related, if not the cause:

  1. from /issues, search for "country: jp". Note that it works and the URL is https://webcompat.com/issues?page=1&per_page=50&state=open&stage=all&sort=created&direction=desc&q=country%3A+jp.
  2. Try to navigate to https://webcompat.com/issues?page=1&per_page=50&state=open&stage=all&sort=created&direction=desc&q=country%3A+jp (or just refresh).
  3. Notice the URL is actually https://webcompat.com/issues?page=1&per_page=50&state=open&stage=all&sort=created&direction=desc&q=country%253A%2Bjp, and in the search input you now have country%3A+jp.

I think we're double encoding the URL here and the GitHub API is like wtf r u doing.

@miketaylr
Copy link
Member

I suspect that's happening here: https://github.com/webcompat/webcompat.com/blob/master/webcompat/static/js/lib/issue-list.js#L517
jQuery.param does encodeURIComponent: https://github.com/jquery/jquery/blob/df2051cf59d054d7ee91bdb554b583471942c6b4/src/serialize.js#L57-L90

So, original stuff works, but we are encoding already encoded junk and then it breaks.

@miketaylr
Copy link
Member

I think this bug is related, if not the cause:

Nah, not the cause, just related to crappy search code. But might as well fix it in this branch.

@magsout
Copy link
Member

magsout commented Jun 11, 2016

@miketaylr I writed a SearchForm Component with React, Redux, History, Form Serialized, Fetch ... Maybe it can be interesting you for webcompat

@magsout
Copy link
Member

magsout commented Apr 26, 2017

althought #1518 is merged, still an issue. I can investigate if you want @miketaylr ?

@miketaylr
Copy link
Member

althought #1518 is merged, still an issue. I can investigate if you want @miketaylr ?

Yes please!

@miketaylr miketaylr assigned magsout and unassigned miketaylr Apr 26, 2017
@magsout
Copy link
Member

magsout commented Apr 26, 2017

@magsout
Copy link
Member

magsout commented Apr 26, 2017

STR:

Navigate to webcompat.com
Click and type 'video'
Click View All Open Issues and switch to View All Issues

Expected Results:
Display related bugs
Actual Results:
Error: "Not Found. Lost in Punk Cat Space"

I'm able to reproduce this issue only if we are not login.

It would seem that this is a response from the local API

@magsout
Copy link
Member

magsout commented Apr 28, 2017

Close due to #1531

@magsout magsout closed this as completed Apr 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants