When using the issue suggestions from GitHub feature and typing #123 in the new issue box, I expect that it autocompletes issue #123 just like GitHub does. When typing Test # or Test & I expect it to show issues from my repository that contain Test.
An error message "GitHub: Validation failed" is displayed. This is apparently because the input from the input box is send to GitHub without proper sanitizing. Thus, everything behind the # ends up in the fragment part of the URL and thus the search string is empty when starting with #. Furthermore if one types Test # or Test &, issues from all repositories containing the phrase "Test" are shown, as the repository restriction is moved to the fragment part or outside the q parameter.
#123 in the new task input boxTest # in the new task input boxProperly encode search input before putting it in the URL. Solution is probably to use encodeURIComponent instead of encodeURI. I noticed that spaces and many other special chars are encoded correctly.
Thanks for opening this up. Actually the search string should already be encoded:
https://github.com/johannesjo/super-productivity/blob/2465e099458526de49ca90d9849462e1262631fe/src/app/features/issue/providers/github/github-api.service.ts#L56
I try to look into it as soon as I can.
That's encodeURI which does not correctly encode &, #, + and = as it would be needed here. encodeURIComponent should do the job.
I was NOT aware of the difference! Thanks for letting me know! :) Would you like to provide a PR yourself? Should be very straightforward then.
Most helpful comment
That's
encodeURIwhich does not correctly encode&,#,+and=as it would be needed here.encodeURIComponentshould do the job.