kibicat / mastodon

A Mastodon‐compatible fediverse instance (the one used by https://glitch.cat.family).
GNU Affero General Public License v3.0
3 stars 0 forks source link

Improve `from` search prefix error handling #37

Closed single-right-quote closed 2 years ago

single-right-quote commented 2 years ago

addresses #36

note https://github.com/mastodon/mastodon/pull/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

single-right-quote commented 2 years ago

updated for upstream rubocop and upstream tests

single-right-quote commented 2 years ago

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 aescling@cat.family@anthuesaho, which the upstream PR will accept

marrus-sh commented 2 years ago

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.

single-right-quote commented 2 years ago

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 :word:) raised no problems

(we really need to set up a test instance)

single-right-quote commented 2 years ago

rubocop reports no (new) offenses; i’m gonna merge and then immediately file an issue to write tests, since we really ought to