diff --git a/packages/backend/src/core/AccountMoveService.ts b/packages/backend/src/core/AccountMoveService.ts index d239155700..1b89512d01 100644 --- a/packages/backend/src/core/AccountMoveService.ts +++ b/packages/backend/src/core/AccountMoveService.ts @@ -81,6 +81,7 @@ export class AccountMoveService { update.alsoKnownAs = src.alsoKnownAs?.concat([dstUri]) ?? [dstUri]; update.movedToUri = dstUri; await this.usersRepository.update(src.id, update); + src = Object.assign(src, update); const srcPerson = await this.apRendererService.renderPerson(src); const updateAct = this.apRendererService.addContext(this.apRendererService.renderUpdate(srcPerson, src)); @@ -109,6 +110,7 @@ export class AccountMoveService { @bindThis public async createAlias(me: LocalUser, updates: Partial): Promise { await this.usersRepository.update(me.id, updates); + me = Object.assign(me, updates); // Publish meUpdated event const iObj = await this.userEntityService.pack(me.id, me, { diff --git a/packages/backend/src/core/activitypub/ApInboxService.ts b/packages/backend/src/core/activitypub/ApInboxService.ts index 95b41626aa..60539e58ee 100644 --- a/packages/backend/src/core/activitypub/ApInboxService.ts +++ b/packages/backend/src/core/activitypub/ApInboxService.ts @@ -765,7 +765,8 @@ export class ApInboxService { } // add target uri to movedToUri in order to indicate that the user has moved - this.usersRepository.update(oldAccount.id, { movedToUri: targetUri }); + await this.usersRepository.update(oldAccount.id, { movedToUri: targetUri }); + oldAccount.movedToUri = targetUri; // Move! await this.accountMoveService.move(oldAccount, newAccount);