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

Outbox: record logs #1197

Open
wants to merge 154 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
5565c26
init
pfefferle Dec 8, 2023
7448cd6
outbox should not be public!
pfefferle Dec 8, 2023
6ac167f
add basic `to_activity` function
pfefferle Dec 11, 2023
704030c
Merge branch 'master' into add/outbox-collection
pfefferle Dec 11, 2023
89ece40
do not allow to instance post transformer
pfefferle Dec 11, 2023
0ba6d7b
Merge branch 'master' into add/outbox-collection
pfefferle Dec 12, 2023
efda4a5
fix tests
pfefferle Dec 12, 2023
1558551
Merge branch 'master' into add/outbox-collection
pfefferle Dec 13, 2023
6edc4b5
Merge branch 'master' into add/outbox-collection
pfefferle Dec 21, 2023
a38c565
Merge branch 'master' into add/outbox-collection
pfefferle Dec 22, 2023
2a3a6c3
Merge branch 'trunk' into add/outbox-collection
pfefferle Sep 27, 2024
5d66494
fix phpcs
pfefferle Sep 27, 2024
b1d260d
revert change
pfefferle Sep 27, 2024
81b0b88
remove unused `use` declarations
pfefferle Sep 27, 2024
8c0c3fa
the handler should not handle outgoing stuff
pfefferle Sep 27, 2024
3eb8ca6
Merge branch 'trunk' into add/outbox-collection
pfefferle Oct 22, 2024
43a3343
Update class-activitypub.php
pfefferle Oct 22, 2024
8746447
fix PHPCS
pfefferle Oct 22, 2024
242dea4
more PHPCS fixes
pfefferle Oct 22, 2024
f64aade
fix namespace issue
pfefferle Oct 22, 2024
5ca19a6
remove unneeded function
pfefferle Oct 22, 2024
9f525b0
fix sticky post endpoint
pfefferle Oct 22, 2024
e0aeefd
no need to check for User-ID
pfefferle Oct 22, 2024
2d3ba4b
Merge branch 'trunk' into add/outbox-collection
pfefferle Oct 23, 2024
1433e4f
Merge branch 'trunk' into add/outbox-collection
pfefferle Oct 23, 2024
943fc02
Merge branch 'trunk' into add/outbox-collection
pfefferle Oct 24, 2024
7f0a227
Merge branch 'trunk' into add/outbox-collection
pfefferle Oct 25, 2024
fb98bd2
Merge branch 'trunk' into add/outbox-collection
pfefferle Oct 26, 2024
945b335
Merge branch 'trunk' into add/outbox-collection
pfefferle Nov 5, 2024
9345991
support JSON and Arrays beside WP_Comments and WP_Posts
pfefferle Nov 5, 2024
d1e9839
fix auto-complete issue
pfefferle Nov 5, 2024
59ab8b9
simplify code.
pfefferle Nov 5, 2024
8133a1c
convert JSON to Activity_Object to not have everything duplicated
pfefferle Nov 5, 2024
0bdb30d
add support for maps and mentions
pfefferle Nov 5, 2024
593740f
Merge branch 'trunk' into add/outbox-collection
pfefferle Nov 7, 2024
748a266
it takes a string (JSON) or an array
pfefferle Nov 12, 2024
db789ff
Merge branch 'trunk' into add/outbox-collection
pfefferle Nov 13, 2024
22aea42
simplified based on the feedback of @obenland
pfefferle Nov 13, 2024
3648062
Merge branch 'add/outbox-collection' of https://github.com/Automattic…
pfefferle Nov 13, 2024
9b20505
rearrange code a bit
pfefferle Nov 14, 2024
617eff7
add missing uses
pfefferle Nov 14, 2024
ad5f35a
fix typo
pfefferle Nov 14, 2024
c1f63b5
add missing uses
pfefferle Nov 14, 2024
193ec0f
Merge branch 'trunk' into add/outbox-collection
pfefferle Nov 14, 2024
b00e64d
Merge branch 'trunk' into add/outbox-collection
pfefferle Nov 20, 2024
b005be7
Merge branch 'trunk' into add/outbox-collection
pfefferle Nov 20, 2024
726729f
Merge branch 'trunk' into add/outbox-collection
pfefferle Nov 20, 2024
ec9d389
Merge branch 'trunk' into add/outbox-collection
pfefferle Nov 21, 2024
37144b8
Merge branch 'trunk' into add/outbox-collection
pfefferle Nov 22, 2024
fe29ea4
Added Changelog-Entry
pfefferle Nov 22, 2024
5b31a6a
Merge branch 'trunk' into add/outbox-collection
pfefferle Dec 5, 2024
8f4f8b1
apply changes from @obenland
pfefferle Dec 6, 2024
f26eb3d
delay scheduling a bit
pfefferle Dec 6, 2024
77f8f06
change scheduling and add possibility to add items to outbox
pfefferle Dec 6, 2024
abef3dc
remove deprecated functions
pfefferle Dec 6, 2024
b93568d
add filter
pfefferle Dec 6, 2024
8d48752
Merge branch 'trunk' into add/outbox-collection
pfefferle Dec 6, 2024
17cc89b
fix indents
pfefferle Dec 6, 2024
535899c
removed deprecated functions
pfefferle Dec 6, 2024
9d8c270
add visibility and normalize autor id
pfefferle Dec 9, 2024
757c8c9
add taxonomies to store actor and actitiy-type informations
pfefferle Dec 11, 2024
400a70a
Merge branch 'trunk' into add/outbox-collection
pfefferle Dec 11, 2024
dd44ee2
Merge branch 'trunk' into add/outbox-collection
pfefferle Dec 11, 2024
451e339
Merge branch 'trunk' into add/outbox-collection
pfefferle Dec 17, 2024
9f81988
Merge branch 'trunk' into add/outbox-collection
obenland Jan 13, 2025
3fc94d3
Fix phpcs
obenland Jan 13, 2025
6589bed
Fix shortcode tests
obenland Jan 14, 2025
fad425e
Update json tests.
obenland Jan 14, 2025
a6e7190
Merge branch 'trunk' into add/outbox-collection
pfefferle Jan 15, 2025
1142be1
move map functions to base transformer
pfefferle Jan 15, 2025
1824b4b
use item instead of wp_object
pfefferle Jan 15, 2025
f9ca53d
protect functions
pfefferle Jan 15, 2025
58a84d9
fix tests and remove legacy tests
pfefferle Jan 15, 2025
c291d03
fix phpcs
pfefferle Jan 15, 2025
1aeb486
add unittests
pfefferle Jan 15, 2025
99a0a48
fix attachment issues and add tests
pfefferle Jan 15, 2025
5d89584
add tests for JSON transformer and fix detected problems
pfefferle Jan 15, 2025
8bea368
fix phpcs issues
pfefferle Jan 15, 2025
1c29caf
add activity-object transformer tests
pfefferle Jan 15, 2025
b654081
simplify code
pfefferle Jan 15, 2025
2077a01
define as global functions
pfefferle Jan 15, 2025
96d1146
re-added setter
pfefferle Jan 15, 2025
f028321
Merge branch 'trunk' into add/outbox-collection
pfefferle Jan 15, 2025
476250c
add content visibility
pfefferle Jan 16, 2025
511b422
fix PHPCS
pfefferle Jan 16, 2025
3720f30
Outbox: Use post meta instead of taxonomies (#1173)
obenland Jan 16, 2025
7e146bf
Update includes/scheduler/class-actor.php
pfefferle Jan 16, 2025
315493a
register content-visibility meta
pfefferle Jan 17, 2025
570d4d3
rename dispatcher
pfefferle Jan 20, 2025
0093c99
Simple dispatcher based on the Outbox-Collection
pfefferle Jan 20, 2025
d467d91
update changelog
pfefferle Jan 20, 2025
bb41713
Merge branch 'trunk' into add/outbox-collection
pfefferle Jan 20, 2025
a6cf6d9
Outbox: Update API Endpoint (#1170)
obenland Jan 20, 2025
aa88405
fix unittests
pfefferle Jan 20, 2025
4b2985b
Merge branch 'add/outbox-collection' of https://github.com/Automattic…
pfefferle Jan 20, 2025
58ee367
Merge branch 'add/outbox-collection' into update/dispatcher
pfefferle Jan 20, 2025
8a7b5cc
pending seems to be the better status
pfefferle Jan 20, 2025
902495a
mark post as `publish` after federation id done
pfefferle Jan 20, 2025
f2500ea
show only published activities
pfefferle Jan 20, 2025
ecbb777
fix missing rename
pfefferle Jan 20, 2025
2d59047
Revert "pending seems to be the better status"
pfefferle Jan 20, 2025
57a4199
use pending instead of draft
pfefferle Jan 20, 2025
07606b9
Merge branch 'add/outbox-collection' into update/dispatcher
mattwiebe Jan 21, 2025
38d8168
Merge branch 'trunk' into add/outbox-collection
mattwiebe Jan 21, 2025
f8e19da
Merge branch 'add/outbox-collection' into update/dispatcher
mattwiebe Jan 21, 2025
38eeafa
do not check for post_status
pfefferle Jan 21, 2025
186547d
fix tests
pfefferle Jan 21, 2025
106b390
Send `Update`s to Blog Actor in dual mode
mattwiebe Jan 21, 2025
79f6b0e
Add logging
mattwiebe Jan 22, 2025
b0810d0
Outbox: Use callbacks that can be unhooked. (#1188)
obenland Jan 22, 2025
d283db6
Outbox: Make sure Last page is linked correctly (#1195)
obenland Jan 22, 2025
0f1257c
Update includes/collection/class-outbox.php
pfefferle Jan 22, 2025
c28d03e
Update includes/collection/class-outbox.php
pfefferle Jan 22, 2025
4fd5642
Update includes/collection/class-outbox.php
pfefferle Jan 22, 2025
6bd1b80
fix type
pfefferle Jan 22, 2025
00a5e2e
rename dispatcher
pfefferle Jan 20, 2025
f224701
Simple dispatcher based on the Outbox-Collection
pfefferle Jan 20, 2025
318a2fd
update changelog
pfefferle Jan 20, 2025
dcc68d3
mark post as `publish` after federation id done
pfefferle Jan 20, 2025
f04c682
show only published activities
pfefferle Jan 20, 2025
3f4672b
fix missing rename
pfefferle Jan 20, 2025
5c6446d
use pending instead of draft
pfefferle Jan 20, 2025
7f28a61
do not check for post_status
pfefferle Jan 21, 2025
a1ce4e8
fix tests
pfefferle Jan 21, 2025
98bbfa1
Send `Update`s to Blog Actor in dual mode
mattwiebe Jan 21, 2025
d83147b
Update includes/class-dispatcher.php
pfefferle Jan 22, 2025
bc9e6af
Update includes/class-dispatcher.php
pfefferle Jan 22, 2025
21d8e46
Update includes/rest/class-outbox-controller.php
pfefferle Jan 22, 2025
06edf3b
Check if Activity should be sent to followers
pfefferle Jan 22, 2025
7957a27
the unique check will be done `send_activity_to_followers`
pfefferle Jan 22, 2025
212c02f
fix tests
pfefferle Jan 22, 2025
361d891
fix PHPCS
pfefferle Jan 22, 2025
978e5b5
move scheduler behind action
pfefferle Jan 22, 2025
72d2fd6
Add `private` visibility
pfefferle Jan 22, 2025
99c1389
Add Announce activity
pfefferle Jan 22, 2025
6707f87
Announce the full object!
pfefferle Jan 22, 2025
243184b
fix indent
pfefferle Jan 22, 2025
17d3b37
Update includes/transformer/class-base.php
pfefferle Jan 22, 2025
0722b12
add doc-block
pfefferle Jan 22, 2025
14a372d
only boost content not profile updates
pfefferle Jan 22, 2025
70266cf
Also handle `Delete` when bundling Blog Actor inboxes
mattwiebe Jan 22, 2025
5b82940
Update docs
obenland Jan 22, 2025
6f87326
Avoid activitypub_actor_mode bleeding into other tests
obenland Jan 22, 2025
8c77845
Fix comments tests
obenland Jan 22, 2025
8332017
Account for inheritance in Activity objects
obenland Jan 22, 2025
3382d7f
Move hook to the right place
obenland Jan 22, 2025
be96f25
Merge branch 'update/dispatcher' into add/dispatch-logging
mattwiebe Jan 22, 2025
e0e9e13
Outbox: Fix Query (#1200)
pfefferle Jan 23, 2025
b1c8945
Fix typo
pfefferle Jan 23, 2025
bc6e7ed
Outbox: Tests and fixes for Post Scheduler (#1196)
obenland Jan 23, 2025
9bcf121
Update Dispatcher to use Outbox (#1186)
pfefferle Jan 23, 2025
1c93236
Merge branch 'add/outbox-collection' into add/dispatch-logging
mattwiebe Jan 23, 2025
bb66680
lighter logging
mattwiebe Jan 23, 2025
433a67f
cleanup merge mess
mattwiebe Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Untitled]
## [Unreleased]

### Changed

Expand All @@ -28,6 +28,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Support for WPML post locale

### Added

* Outbox queue

### Changed

* Rewrite the current dispatcher system, to use the Outbox instead of the Scheduler.

### Removed

* Built-in support for nodeinfo2. Use the [NodeInfo plugin](https://wordpress.org/plugins/nodeinfo/) instead.
Expand Down
6 changes: 3 additions & 3 deletions activitypub.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
*/
function rest_init() {
Rest\Actors::init();
Rest\Outbox::init();
Rest\Inbox::init();
Rest\Followers::init();
Rest\Following::init();
Rest\Comment::init();
Rest\Server::init();
Rest\Collection::init();
Rest\Post::init();
( new Rest\Interaction_Controller() )->register_routes();
( new Rest\Application_Controller() )->register_routes();
( new Rest\Interaction_Controller() )->register_routes();
( new Rest\Outbox_Controller() )->register_routes();
( new Rest\Webfinger_Controller() )->register_routes();

// Load NodeInfo endpoints only if blog is public.
Expand All @@ -65,7 +65,7 @@ function rest_init() {
function plugin_init() {
\add_action( 'init', array( __NAMESPACE__ . '\Migration', 'init' ) );
\add_action( 'init', array( __NAMESPACE__ . '\Activitypub', 'init' ) );
\add_action( 'init', array( __NAMESPACE__ . '\Activity_Dispatcher', 'init' ) );
\add_action( 'init', array( __NAMESPACE__ . '\Dispatcher', 'init' ) );
\add_action( 'init', array( __NAMESPACE__ . '\Handler', 'init' ) );
\add_action( 'init', array( __NAMESPACE__ . '\Admin', 'init' ) );
\add_action( 'init', array( __NAMESPACE__ . '\Hashtag', 'init' ) );
Expand Down
10 changes: 3 additions & 7 deletions includes/activity/class-base-object.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ public static function init_from_json( $json ) {
$array = \json_decode( $json, true );

if ( ! is_array( $array ) ) {
$array = array();
return new WP_Error( 'invalid_json', __( 'Invalid JSON', 'activitypub' ), array( 'status' => 400 ) );
}

return self::init_from_array( $array );
Expand All @@ -600,15 +600,11 @@ public static function init_from_json( $json ) {
*/
public static function init_from_array( $data ) {
if ( ! is_array( $data ) ) {
return new WP_Error( 'invalid_array', __( 'Invalid array', 'activitypub' ), array( 'status' => 404 ) );
return new WP_Error( 'invalid_array', __( 'Invalid array', 'activitypub' ), array( 'status' => 400 ) );
}

$object = new static();

foreach ( $data as $key => $value ) {
$key = camel_to_snake_case( $key );
call_user_func( array( $object, 'set_' . $key ), $value );
}
$object->from_array( $data );

return $object;
}
Expand Down
Loading
Loading