Skip to content

Conversation

obenland
Copy link
Member

The WebFinger Resource is not accessible. or The "object" is/has no valid URL are not terribly great error messages. This PR updates the error message when we can't follow an account to something more user-friendly, albeit slightly less detailed.
It also improves user experience by re-supplying the attempted username, instead of forcing folks to type it back in again.

Proposed changes:

  • Removes resource query arg to not pre-fill the username again after submitting the follow form.
  • Updated error message to be a bit more user-friendly.
  • Re-fills the username after a failed follow attempt.
  • Also updates missing html entities in form string (sorry, Claude went above and beyond)

obenland added 2 commits July 21, 2025 10:15
Enhanced error messages when following accounts by providing more specific feedback and preserving the entered profile on redirect. Updated template text for clarity and consistency in the following list UI.
@obenland obenland requested a review from pfefferle July 21, 2025 15:23
@obenland obenland self-assigned this Jul 21, 2025
@Copilot Copilot AI review requested due to automatic review settings July 21, 2025 15:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the user experience when following accounts fails by providing more user-friendly error messages and better form handling. The changes replace technical error messages with clearer feedback and maintain the attempted username in the form after failed follow attempts.

  • Updates error handling to show a generic, user-friendly message instead of technical WebFinger/ActivityPub errors
  • Modifies URL parameter handling to prevent pre-filling usernames on successful follows while re-filling on failures
  • Fixes HTML entity encoding inconsistencies in template strings

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
includes/table/class-following.php Updates error handling logic and URL parameter management for follow attempts
templates/following-list.php Corrects HTML entity encoding in user-facing text

@obenland obenland added the Skip Changelog Disables the "Changelog Updated" action for PRs where changelog entries are not necessary. label Jul 21, 2025
if ( \is_wp_error( $result ) ) {
\add_settings_error( 'activitypub', 'followed', $result->get_error_message() );
/* translators: %s: Account profile that could not be followed */
\add_settings_error( 'activitypub', 'followed', \sprintf( \__( 'Unable to follow account “%s”. Please verify the account exists and try again.', 'activitypub' ), \esc_html( $profile ) ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we maybe (also) change the origin error message to be more desciptive and enduser friendly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that would be good

@obenland obenland merged commit 3b2f229 into trunk Jul 21, 2025
12 of 13 checks passed
@obenland obenland deleted the update/follow-error-handling branch July 21, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Disables the "Changelog Updated" action for PRs where changelog entries are not necessary.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants