fix(backend): avoid deadlock when deleting account (#16162)
This commit is contained in:
parent
b55cc03621
commit
65ba33867b
|
@ -15,6 +15,7 @@
|
|||
|
||||
### Server
|
||||
- Feat: 全てのチャットメッセージを既読にするAPIを追加(chat/read-all)
|
||||
- Fix: アカウント削除が正常に行われないことがあった問題を修正
|
||||
|
||||
|
||||
## 2025.6.0
|
||||
|
|
|
@ -803,14 +803,14 @@ export class DriveService {
|
|||
await Promise.all(promises);
|
||||
}
|
||||
|
||||
this.deletePostProcess(file, isExpired, deleter);
|
||||
await this.deletePostProcess(file, isExpired, deleter);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async deletePostProcess(file: MiDriveFile, isExpired = false, deleter?: MiUser) {
|
||||
// リモートファイル期限切れ削除後は直リンクにする
|
||||
if (isExpired && file.userHost !== null && file.uri != null) {
|
||||
this.driveFilesRepository.update(file.id, {
|
||||
await this.driveFilesRepository.update(file.id, {
|
||||
isLink: true,
|
||||
url: file.uri,
|
||||
thumbnailUrl: null,
|
||||
|
@ -822,7 +822,7 @@ export class DriveService {
|
|||
webpublicAccessKey: 'webpublic-' + randomUUID(),
|
||||
});
|
||||
} else {
|
||||
this.driveFilesRepository.delete(file.id);
|
||||
await this.driveFilesRepository.delete(file.id);
|
||||
}
|
||||
|
||||
this.driveChart.update(file, false);
|
||||
|
|
|
@ -380,9 +380,7 @@ describe('User', () => {
|
|||
strictEqual(followers.length, 1); // followed by Bob
|
||||
|
||||
await alice.client.request('i/delete-account', { password: alice.password });
|
||||
// NOTE: user deletion query is slow
|
||||
// FIXME: ensure user is removed successfully
|
||||
await sleep(10000);
|
||||
await sleep();
|
||||
|
||||
const following = await bob.client.request('users/following', { userId: bob.id });
|
||||
strictEqual(following.length, 0); // no following relation
|
||||
|
@ -480,9 +478,7 @@ describe('User', () => {
|
|||
strictEqual(followers.length, 1); // followed by Bob
|
||||
|
||||
await aAdmin.client.request('admin/suspend-user', { userId: alice.id });
|
||||
// NOTE: user deletion query is slow
|
||||
// FIXME: ensure user is removed successfully
|
||||
await sleep(10000);
|
||||
await sleep();
|
||||
|
||||
const following = await bob.client.request('users/following', { userId: bob.id });
|
||||
strictEqual(following.length, 0); // no following relation
|
||||
|
|
Loading…
Reference in New Issue