enhance(backend): refine system account (#15530)
* wip
* wip
* wip
* Update SystemAccountService.ts
* Update 1740121393164-system-accounts.js
* Update DeleteAccountService.ts
* wip
* wip
* wip
* wip
* Update 1740121393164-system-accounts.js
* Update RepositoryModule.ts
* wip
* wip
* wip
* Update ApRendererService.ts
* wip
* wip
* Update SystemAccountService.ts
* fix tests
* fix tests
* fix tests
* fix tests
* fix tests
* fix tests
* add print logs
* ログが長すぎて出てないかもしれない
* fix migration
* refactor
* fix fed-tests
* Update RelayService.ts
* merge
* Update user.test.ts
* chore: emit log
* fix: tweak sleep duration
* fix: exit 1
* fix: wait for misskey processes to become healthy
* fix: longer sleep for user deletion
* fix: make sleep longer again
* デッドロック解消の試み
https://github.com/misskey-dev/misskey/issues/15005
* Revert "デッドロック解消の試み"
This reverts commit 266141f66f.
* wip
* Update SystemAccountService.ts
---------
Co-authored-by: おさむのひと <46447427+samunohito@users.noreply.github.com>
Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>
			
			
This commit is contained in:
		@@ -20,8 +20,12 @@ services:
 | 
			
		||||
    depends_on:
 | 
			
		||||
      a.test:
 | 
			
		||||
        condition: service_healthy
 | 
			
		||||
      misskey.a.test:
 | 
			
		||||
        condition: service_healthy
 | 
			
		||||
      b.test:
 | 
			
		||||
        condition: service_healthy
 | 
			
		||||
      misskey.b.test:
 | 
			
		||||
        condition: service_healthy
 | 
			
		||||
    environment:
 | 
			
		||||
      - NODE_ENV=development
 | 
			
		||||
      - NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/rootCA.crt
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@ describe('Abuse report', () => {
 | 
			
		||||
			const reportsInB = await bModerator.client.request('admin/abuse-user-reports', {});
 | 
			
		||||
			const reportInB = reportsInB.filter(report => report.comment.includes(comment))[0];
 | 
			
		||||
			// NOTE: reporter is not Alice, and is not moderator in A
 | 
			
		||||
			strictEqual(reportInB.reporter.url, 'https://a.test/@instance.actor');
 | 
			
		||||
			strictEqual(reportInB.reporter.url, 'https://a.test/@system.actor');
 | 
			
		||||
			strictEqual(reportInB.targetUserId, bob.id);
 | 
			
		||||
 | 
			
		||||
			// NOTE: cannot forward multiple times
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,7 @@ describe('User', () => {
 | 
			
		||||
					'id',
 | 
			
		||||
					'host',
 | 
			
		||||
					'avatarUrl',
 | 
			
		||||
					'avatarBlurhash',
 | 
			
		||||
					'instance',
 | 
			
		||||
					'badgeRoles',
 | 
			
		||||
					'url',
 | 
			
		||||
@@ -379,7 +380,8 @@ describe('User', () => {
 | 
			
		||||
				strictEqual(followers.length, 1); // followed by Bob
 | 
			
		||||
 | 
			
		||||
				await alice.client.request('i/delete-account', { password: alice.password });
 | 
			
		||||
				await sleep();
 | 
			
		||||
				// NOTE: user deletion query is slow
 | 
			
		||||
				await sleep(4000);
 | 
			
		||||
 | 
			
		||||
				const following = await bob.client.request('users/following', { userId: bob.id });
 | 
			
		||||
				strictEqual(following.length, 0); // no following relation
 | 
			
		||||
@@ -477,7 +479,8 @@ describe('User', () => {
 | 
			
		||||
				strictEqual(followers.length, 1); // followed by Bob
 | 
			
		||||
 | 
			
		||||
				await aAdmin.client.request('admin/suspend-user', { userId: alice.id });
 | 
			
		||||
				await sleep();
 | 
			
		||||
				// NOTE: user deletion query is slow
 | 
			
		||||
				await sleep(4000);
 | 
			
		||||
 | 
			
		||||
				const following = await bob.client.request('users/following', { userId: bob.id });
 | 
			
		||||
				strictEqual(following.length, 0); // no following relation
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@ export type Request = <
 | 
			
		||||
 | 
			
		||||
type Host = 'a.test' | 'b.test';
 | 
			
		||||
 | 
			
		||||
export async function sleep(ms = 200): Promise<void> {
 | 
			
		||||
export async function sleep(ms = 250): Promise<void> {
 | 
			
		||||
	return new Promise(resolve => setTimeout(resolve, ms));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user