Skip to content

Conversation

@pfefferle
Copy link
Member

@pfefferle pfefferle commented Dec 3, 2025

Proposed changes:

  • Store webfinger acct in _activitypub_acct post meta when creating/updating remote actors
  • Retrieve and populate webfinger in actor object when loading remote actors from database
  • Generate webfinger from actor ID/URL when not already available

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Create or update a remote actor
  • Verify that _activitypub_acct post meta is stored with the webfinger address
  • Load a remote actor from the database
  • Verify that the actor object has the webfinger field populated
  • Test with actors that have webfinger and those that need it generated
  • Run PHPUnit tests: ./vendor/bin/phpunit tests/phpunit/tests/includes/collection/class-test-remote-actors.php

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Store and retrieve webfinger acct for remote actors to improve identification and reduce lookups

pfefferle and others added 2 commits December 3, 2025 15:00
Add storage and retrieval of webfinger acct (_activitypub_acct) for remote actors to improve actor identification and reduce webfinger lookups.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replaces the variable name 'acct' with 'webfinger' for clarity and consistency when handling actor webfinger accounts in Remote_Actors. No functional changes were made.
Copilot AI review requested due to automatic review settings December 3, 2025 14:01
@pfefferle pfefferle self-assigned this Dec 3, 2025
@pfefferle pfefferle requested a review from a team December 3, 2025 14:01
Copy link

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 adds persistence and retrieval of webfinger account identifiers for remote ActivityPub actors to optimize lookups and improve actor identification.

  • Store webfinger acct in post meta when creating/updating remote actors
  • Retrieve and populate webfinger from stored meta or generate it when loading actors
  • Add fallback generation logic when webfinger is not available

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
includes/collection/class-remote-actors.php Adds webfinger storage in _activitypub_acct meta field and retrieval logic with fallback generation
.github/changelog/2575-from-description Adds changelog entry documenting the webfinger storage feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add comprehensive test coverage for:
- Storing webfinger acct when creating actors
- Populating webfinger when loading actors from database
- Generating webfinger from actor URL when not available
- Updating webfinger acct when actor is updated
- Using webfinger from actor object when provided
Update Webfinger::guess fallback to use object_to_uri with a null coalescing check on actor URL or ID. This ensures a valid URI is always passed, preventing errors when actor URLs are missing.
Update calls to Webfinger::guess to pass the actor object directly instead of converting to URI. This simplifies the code and ensures consistent handling of actor data.
@pfefferle pfefferle force-pushed the enhancement/store-webfinger-acct branch from 2888778 to 597a8ca Compare December 3, 2025 14:14
pfefferle and others added 13 commits December 3, 2025 15:30
…rs.php

Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php

Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php

Co-authored-by: Konstantin Obenland <obenland@gmx.de>
Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php

Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php

Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php

Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php

Co-authored-by: Konstantin Obenland <obenland@gmx.de>
Refines the logic for setting the webfinger property on remote actors. Now attempts to retrieve the value from post meta, falls back to URI conversion, and uses a guessing method if necessary, ensuring the value is sanitized before assignment.
Simplifies the acct property assignment by using $actor->get_webfinger() instead of converting the actor ID with Webfinger_Util::uri_to_acct. Removes unnecessary string manipulation and error checking.
@github-actions github-actions bot added the [Focus] Compatibility Ensuring the plugin plays well with other plugins label Dec 3, 2025
@pfefferle pfefferle merged commit b61302a into trunk Dec 3, 2025
10 checks passed
@pfefferle pfefferle deleted the enhancement/store-webfinger-acct branch December 3, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants