-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve from
search prefix error handling
#37
Conversation
) * Improve robustness for account string validation Using unsupported prefixes now reports a 422; searching for posts from an account the instance is not aware of reports a 404. TODO: The UI for this on the front end is abysmal. Searching `from:username@domain` now succeeds when `domain` is the local domain; searching `from:@username(@Domain)?` now works as expected. * Satisfy upstream rubcocp * Unbreak upstream tests
945c9b1
to
db8fcc6
Compare
updated for upstream rubocop and upstream tests |
we will not be incorporating upstream’s requested changes as i prefer to alert the user to syntactically invalid account strings; as well as to reject account strings like |
from
search prefix more robust (addresses mastodon/mastodon#17941)from
search prefix error handling (addresses mastodon/mastodon#17941)
from
search prefix error handling (addresses mastodon/mastodon#17941)from
search prefix error handling (addresses mastodon/mastodon#17941) #36
from
search prefix error handling (addresses mastodon/mastodon#17941) #36from
search prefix error handling
It’d be nice to have tests for at least the new methods, so that if something upstream breaks this we would have some manner of indication. I wouldn’t rate it as an especially high priority though. |
Incorporates changes suggested in #37. In doing so, adopts an error handling style more consistent with the existing codebase (for which I must thank @ClearlyClaire). Removes new code no longer in use.
i really should add tests but my smoke tests (running these commits briefly on GlitchCat and testing that searches work, and and that searchs 422 on one-character domain names or domain names ending not in (we really need to set up a test instance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Feel free to merge if you don’t want to bother with tests yet; maybe at least run rubocop though if you haven’t since we don’t have CI.
rubocop reports no (new) offenses; i’m gonna merge and then immediately file an issue to write tests, since we really ought to |
addresses #36
note mastodon/mastodon#17963; i expect they will ask for adjustments there; i further expect to make impactful design changes. i am still opening this PR as we are currently running this on GlitchCat anyway, with no reported problems