Utopian Search #keyword hashtag is not escaped

in utopian-io •  7 years ago  (edited)

There are two types queries for two different endpoints based on the category as far as i see. Github api search and utopian api.

Expected behavior

Should url encode the hashtag and ad return results properly for github.
Should keep the hashtag and url encode properly for the utopian api search.

Actual behavior

When the search is done through Github the following is returned:

{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Search",
      "field": "q",
      "code": "missing"
    }
  ],
  "documentation_url": "https://developer.github.com/v3/search"
}

The q parameter aka the search term is missing, it is ignored because of the hashtag.

When searching on utopian api the search term is missing in the request


Sends a query of:

https://api.utopian.io/api/posts/?limit=20&skip=0&section=all&sortBy=created&type=sub-projects&bySimilarity=&reset=
bySimilarity=

is empty while it should have been

bySimilarity=%23test

How to reproduce

Go to utopian.io
Make sure in the search box you selected Projects: (For github search)
Type #busy

Search fails with hashtag.

Now try with Development category
And type busy:

Search works. But when you try with hashtag #busy search

Tested on:

  • Browser: Firefox, Chrome
  • Operating system: Windows 10, Ubuntu

Related Issue:

https://github.com/utopian-io/utopian.io/issues/26

For clarification:
The linked issue is a feature request of searching by tags.

My issue is a bug report of being unable to search when the search term starts with hashtags. I found the explained bug above while examining the github issue.



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

@azarus, Upvote for supporting you.

  ·  7 years ago 

Could you connect your github account? thanks

it's connected

  ·  7 years ago 

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @azarus I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x