register instances before creating a user

This commit is contained in:
Hazelnoot 2025-05-24 23:48:36 -04:00
parent 139f458c0b
commit 08834f1722

View file

@ -398,6 +398,9 @@ export class ApPersonService implements OnModuleInit, OnApplicationShutdown {
const followerscollection = await _resolver.resolveCollection(person.followers!).catch(() => { return null; });
const followingcollection = await _resolver.resolveCollection(person.following!).catch(() => { return null; });
// Register the instance first, to avoid FK errors
await this.federatedInstanceService.fetchOrRegister(host);
try {
// Start transaction
await this.db.transaction(async transactionalEntityManager => {