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

Improve from search prefix error handling #37

Merged
merged 3 commits into from
Apr 9, 2022
Merged

Commits on Apr 6, 2022

  1. Make from search prefix more robust (addresses mastodon/mastodon#17941

    )
    
    * 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
    aescling committed Apr 6, 2022
    Configuration menu
    Copy the full SHA
    db8fcc6 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2022

  1. Make account string validation consistent with mention processing

    We previously matched on one-character domains and domains ending with
    `[\.-]`, allowing `from:@A@a` and `from:@A@a-` searches to cause an
    account lookup. This commit will raise a syntax error in both cases, as
    MENTION_RE would never match them.
    aescling committed Apr 9, 2022
    Configuration menu
    Copy the full SHA
    04087db View commit details
    Browse the repository at this point in the history
  2. Refactor from prefix error handling.

    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.
    aescling committed Apr 9, 2022
    Configuration menu
    Copy the full SHA
    f537f1d View commit details
    Browse the repository at this point in the history