Merge pull request '[PR]: fix: skip deleting remote actor if not found or already deleted' (#10310) from nmkj/calckey:fix-delete-actor into develop
Reviewed-on: https://codeberg.org/calckey/calckey/pulls/10310
This commit is contained in:
commit
5cccb3378c
|
@ -17,9 +17,7 @@ export async function deleteAccount(
|
|||
logger.info(`Deleting account of ${job.data.user.id} ...`);
|
||||
|
||||
const user = await Users.findOneBy({ id: job.data.user.id });
|
||||
if (user == null) {
|
||||
return;
|
||||
}
|
||||
if (!user) return;
|
||||
|
||||
{
|
||||
// Delete notes
|
||||
|
|
|
@ -15,9 +15,11 @@ export async function deleteActor(
|
|||
return `skip: delete actor ${actor.uri} !== ${uri}`;
|
||||
}
|
||||
|
||||
const user = await Users.findOneByOrFail({ id: actor.id });
|
||||
if (user.isDeleted) {
|
||||
logger.info("skip: already deleted");
|
||||
const user = await Users.findOneBy({ id: actor.id });
|
||||
if (!user) {
|
||||
return `skip: actor ${actor.id} not found in the local database`;
|
||||
} else if (user.isDeleted) {
|
||||
return `skip: user ${user.id} already deleted`;
|
||||
}
|
||||
|
||||
const job = await createDeleteAccountJob(actor);
|
||||
|
|
Loading…
Reference in New Issue