Update Move pipeline, add debug logging

This commit is contained in:
Daniel Supernault 2024-09-07 04:18:07 -06:00
parent 0cba7d7d7d
commit 5558535aea
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1
2 changed files with 7 additions and 2 deletions

View file

@ -9,6 +9,7 @@ use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Queue\Middleware\ThrottlesExceptions;
use Illuminate\Queue\Middleware\WithoutOverlapping;
use DateTime;
use Log;
class ProcessMovePipeline implements ShouldQueue
{
@ -86,11 +87,13 @@ class ProcessMovePipeline implements ShouldQueue
$res = ActivityPubFetchService::fetchRequest($this->target, true);
if (! $res || ! isset($res['alsoKnownAs'])) {
Log::info('[AP][INBOX][MOVE] target_aka failure');
return false;
}
$res = Helpers::profileFetch($this->target);
if (! $res) {
Log::info('[AP][INBOX][MOVE] target fetch failure');
return false;
}
@ -112,11 +115,13 @@ class ProcessMovePipeline implements ShouldQueue
$res = ActivityPubFetchService::fetchRequest($this->actor, true);
if (! $res || ! isset($res['movedTo'])) {
Log::info('[AP][INBOX][MOVE] actor_movedTo failure');
return false;
}
$res = Helpers::profileFetch($this->actor);
if (! $res) {
Log::info('[AP][INBOX][MOVE] actor fetch failure');
return false;
}

View file

@ -145,7 +145,6 @@ class Inbox
case 'Move':
if (MoveValidator::validate($this->payload) == false) {
\Log::info('[AP][INBOX][MOVE] VALIDATE_FAILURE '.json_encode($this->payload));
return;
}
$this->handleMoveActivity();
@ -1367,6 +1366,7 @@ class Inbox
! Helpers::validateUrl($activity) ||
! Helpers::validateUrl($target)
) {
\Log::info('[AP][INBOX][MOVE] validateUrl fail');
return;
}
@ -1375,6 +1375,6 @@ class Inbox
new MoveMigrateFollowersPipeline($target, $activity),
new UnfollowLegacyAccountMovePipeline($target, $activity),
new CleanupLegacyAccountMovePipeline($target, $activity),
])->onQueue('move')->dispatch();
])->onQueue('move')->dispatchSync();
}
}