properly handle unresolvable move target
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline failed
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/pr/test Pipeline failed
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline failed
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline failed
This commit is contained in:
parent
27ddb2496c
commit
eb2f8cae13
1 changed files with 3 additions and 6 deletions
|
@ -68,15 +68,12 @@ async function validateActor(x: IObject, resolver: Resolver): Promise<IActor> {
|
||||||
if (x.movedTo === uri) {
|
if (x.movedTo === uri) {
|
||||||
throw new Error('invalid Actor: moved to self');
|
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)
|
await resolvePerson(x.movedTo, resolver)
|
||||||
.then(moveTarget => {
|
.then(moveTarget => {
|
||||||
x.movedTo = moveTarget.id
|
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;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue