mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Update Move pipeline, add debug logging
This commit is contained in:
parent
0cba7d7d7d
commit
5558535aea
2 changed files with 7 additions and 2 deletions
|
@ -9,6 +9,7 @@ use Illuminate\Foundation\Queue\Queueable;
|
||||||
use Illuminate\Queue\Middleware\ThrottlesExceptions;
|
use Illuminate\Queue\Middleware\ThrottlesExceptions;
|
||||||
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
use Log;
|
||||||
|
|
||||||
class ProcessMovePipeline implements ShouldQueue
|
class ProcessMovePipeline implements ShouldQueue
|
||||||
{
|
{
|
||||||
|
@ -86,11 +87,13 @@ class ProcessMovePipeline implements ShouldQueue
|
||||||
$res = ActivityPubFetchService::fetchRequest($this->target, true);
|
$res = ActivityPubFetchService::fetchRequest($this->target, true);
|
||||||
|
|
||||||
if (! $res || ! isset($res['alsoKnownAs'])) {
|
if (! $res || ! isset($res['alsoKnownAs'])) {
|
||||||
|
Log::info('[AP][INBOX][MOVE] target_aka failure');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = Helpers::profileFetch($this->target);
|
$res = Helpers::profileFetch($this->target);
|
||||||
if (! $res) {
|
if (! $res) {
|
||||||
|
Log::info('[AP][INBOX][MOVE] target fetch failure');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,11 +115,13 @@ class ProcessMovePipeline implements ShouldQueue
|
||||||
$res = ActivityPubFetchService::fetchRequest($this->actor, true);
|
$res = ActivityPubFetchService::fetchRequest($this->actor, true);
|
||||||
|
|
||||||
if (! $res || ! isset($res['movedTo'])) {
|
if (! $res || ! isset($res['movedTo'])) {
|
||||||
|
Log::info('[AP][INBOX][MOVE] actor_movedTo failure');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = Helpers::profileFetch($this->actor);
|
$res = Helpers::profileFetch($this->actor);
|
||||||
if (! $res) {
|
if (! $res) {
|
||||||
|
Log::info('[AP][INBOX][MOVE] actor fetch failure');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,6 @@ class Inbox
|
||||||
case 'Move':
|
case 'Move':
|
||||||
if (MoveValidator::validate($this->payload) == false) {
|
if (MoveValidator::validate($this->payload) == false) {
|
||||||
\Log::info('[AP][INBOX][MOVE] VALIDATE_FAILURE '.json_encode($this->payload));
|
\Log::info('[AP][INBOX][MOVE] VALIDATE_FAILURE '.json_encode($this->payload));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->handleMoveActivity();
|
$this->handleMoveActivity();
|
||||||
|
@ -1367,6 +1366,7 @@ class Inbox
|
||||||
! Helpers::validateUrl($activity) ||
|
! Helpers::validateUrl($activity) ||
|
||||||
! Helpers::validateUrl($target)
|
! Helpers::validateUrl($target)
|
||||||
) {
|
) {
|
||||||
|
\Log::info('[AP][INBOX][MOVE] validateUrl fail');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1375,6 +1375,6 @@ class Inbox
|
||||||
new MoveMigrateFollowersPipeline($target, $activity),
|
new MoveMigrateFollowersPipeline($target, $activity),
|
||||||
new UnfollowLegacyAccountMovePipeline($target, $activity),
|
new UnfollowLegacyAccountMovePipeline($target, $activity),
|
||||||
new CleanupLegacyAccountMovePipeline($target, $activity),
|
new CleanupLegacyAccountMovePipeline($target, $activity),
|
||||||
])->onQueue('move')->dispatch();
|
])->onQueue('move')->dispatchSync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue