summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/AccountMoveService.ts
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2025-03-02 16:51:54 +0000
committerdakkar <dakkar@thenautilus.net>2025-03-02 16:51:54 +0000
commit0fba8dc26ac39d82b5add1756e555070bf18eb52 (patch)
tree1c5a5a4a16787822e208e13dcaa5789627fa3416 /packages/backend/src/core/AccountMoveService.ts
parenthandle scheduled notes when migrating account - fixes #931 (diff)
downloadsharkey-0fba8dc26ac39d82b5add1756e555070bf18eb52.tar.gz
sharkey-0fba8dc26ac39d82b5add1756e555070bf18eb52.tar.bz2
sharkey-0fba8dc26ac39d82b5add1756e555070bf18eb52.zip
don't move scheduled notes to new account when migrating
@Julia confirms it would confuse people more than it helps
Diffstat (limited to 'packages/backend/src/core/AccountMoveService.ts')
-rw-r--r--packages/backend/src/core/AccountMoveService.ts15
1 files changed, 2 insertions, 13 deletions
diff --git a/packages/backend/src/core/AccountMoveService.ts b/packages/backend/src/core/AccountMoveService.ts
index 0eb8a76bff..e24fefb4b5 100644
--- a/packages/backend/src/core/AccountMoveService.ts
+++ b/packages/backend/src/core/AccountMoveService.ts
@@ -122,7 +122,7 @@ export class AccountMoveService {
await Promise.all([
this.copyBlocking(src, dst),
this.copyMutings(src, dst),
- this.updateScheduledNotes(src, dst),
+ this.deleteScheduledNotes(src),
this.updateLists(src, dst),
]);
} catch {
@@ -206,18 +206,7 @@ export class AccountMoveService {
}
@bindThis
- public async updateScheduledNotes(src: ThinUser, dst: MiUser): Promise<void> {
- // we're moving to a different local user: change scheduled notes' ownership
- if (dst.host === null) {
- await this.noteScheduleRepository.update(
- { userId: src.id },
- { userId: dst.id },
- );
-
- return;
- }
-
- // we're moving to a remote user: delete scheduled notes
+ public async deleteScheduledNotes(src: ThinUser): Promise<void> {
const scheduledNotes = await this.noteScheduleRepository.findBy({
userId: src.id,
}) as MiNoteSchedule[];