properly handle unresolvable move target
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/lint-backend Pipeline was successful Details
ci/woodpecker/push/lint-client Pipeline was successful Details
ci/woodpecker/push/lint-sw Pipeline was successful Details
ci/woodpecker/push/test Pipeline was successful Details
ci/woodpecker/pr/lint-foundkey-js Pipeline failed Details
ci/woodpecker/pr/lint-client Pipeline failed Details
ci/woodpecker/pr/lint-backend Pipeline failed Details
ci/woodpecker/pr/build Pipeline was successful Details
ci/woodpecker/pr/lint-sw Pipeline failed Details
ci/woodpecker/pr/test Pipeline failed Details

This commit is contained in:
Johann150 2023-03-22 21:28:04 +01:00
parent 27ddb2496c
commit eb2f8cae13
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 3 additions and 6 deletions

View File

@ -68,15 +68,12 @@ async function validateActor(x: IObject, resolver: Resolver): Promise<IActor> {
if (x.movedTo === uri) {
throw new Error('invalid Actor: moved to self');
}
// This may throw an exception if we cannot resolve the move target.
// If we are processing an incoming activity, this is desired behaviour
// because that will cause the activity to be retried.
await resolvePerson(x.movedTo, resolver)
.then(moveTarget => {
x.movedTo = moveTarget.id
})
.catch((err: Error) => {
// Can't find the move target for some reason.
// Don't treat the actor as invalid, just ignore the movedTo.
logger.warn(`cannot find move target "${x.movedTo}", error: ${err.toString()}`);
delete x.movedTo;
});
}