From ac6a8edf0b3ea7586ae976610e90b7ec505d5d4f Mon Sep 17 00:00:00 2001 From: hutchisr <42283663+hutchisr@users.noreply.github.com> Date: Tue, 25 Jul 2023 00:32:52 -0700 Subject: [PATCH 01/26] Use BullMQAdapter (#11367) --- packages/backend/src/server/web/ClientServerService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index b5eea07775..363cca8feb 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -3,7 +3,7 @@ import { dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; import { Inject, Injectable } from '@nestjs/common'; import { createBullBoard } from '@bull-board/api'; -import { BullAdapter } from '@bull-board/api/bullAdapter.js'; +import { BullMQAdapter } from '@bull-board/api/bullMQAdapter.js'; import { FastifyAdapter } from '@bull-board/fastify'; import ms from 'ms'; import sharp from 'sharp'; @@ -168,7 +168,7 @@ export class ClientServerService { this.dbQueue, this.objectStorageQueue, this.webhookDeliverQueue, - ].map(q => new BullAdapter(q)), + ].map(q => new BullMQAdapter(q)), serverAdapter, }); From c1a19ff900b30fb318b3eb8aea96b80d7b48c5ef Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 25 Jul 2023 19:21:50 +0900 Subject: [PATCH 02/26] fix(backend): Use OFFSET instead of SKIP when using LIMIT (#11379) * fix(backend): Use OFFSET instead of SKIP when using LIMIT * update CHANGELOG.md --- CHANGELOG.md | 2 +- .../backend/src/server/api/endpoints/admin/invite/list.ts | 2 +- .../backend/src/server/api/endpoints/admin/show-users.ts | 2 +- .../src/server/api/endpoints/federation/instances.ts | 2 +- .../backend/src/server/api/endpoints/hashtags/search.ts | 2 +- .../src/server/api/endpoints/notes/polls/recommendation.ts | 2 +- packages/backend/src/server/api/endpoints/users.ts | 2 +- .../src/server/api/endpoints/users/recommendation.ts | 2 +- packages/backend/src/server/api/endpoints/users/search.ts | 6 +++--- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00ca2982cd..778438729c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ - リストTLで、ユーザーが追加・削除されてもTLを初期化しないように ### Server -- +- Fix: APIのオフセットが壊れていたせいで「もっと見る」でもっと見れない問題を修正 ## 13.14.1 diff --git a/packages/backend/src/server/api/endpoints/admin/invite/list.ts b/packages/backend/src/server/api/endpoints/admin/invite/list.ts index 5d7a7f632c..d8bf6e286f 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite/list.ts @@ -60,7 +60,7 @@ export default class extends Endpoint { } query.limit(ps.limit); - query.skip(ps.offset); + query.offset(ps.offset); const tickets = await query.getMany(); diff --git a/packages/backend/src/server/api/endpoints/admin/show-users.ts b/packages/backend/src/server/api/endpoints/admin/show-users.ts index 0a150d1dfd..2ae5bc3de3 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-users.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts @@ -105,7 +105,7 @@ export default class extends Endpoint { } query.limit(ps.limit); - query.skip(ps.offset); + query.offset(ps.offset); const users = await query.getMany(); diff --git a/packages/backend/src/server/api/endpoints/federation/instances.ts b/packages/backend/src/server/api/endpoints/federation/instances.ts index ddf1a178b1..b140321f44 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -126,7 +126,7 @@ export default class extends Endpoint { query.andWhere('instance.host like :host', { host: '%' + sqlLikeEscape(ps.host.toLowerCase()) + '%' }); } - const instances = await query.limit(ps.limit).skip(ps.offset).getMany(); + const instances = await query.limit(ps.limit).offset(ps.offset).getMany(); return await this.instanceEntityService.packMany(instances); }); diff --git a/packages/backend/src/server/api/endpoints/hashtags/search.ts b/packages/backend/src/server/api/endpoints/hashtags/search.ts index e2e00def79..81a790316b 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/search.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/search.ts @@ -42,7 +42,7 @@ export default class extends Endpoint { .orderBy('tag.count', 'DESC') .groupBy('tag.id') .limit(ps.limit) - .skip(ps.offset) + .offset(ps.offset) .getMany(); return hashtags.map(tag => tag.name); diff --git a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts index 0b4ccdcf20..889f644643 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts @@ -83,7 +83,7 @@ export default class extends Endpoint { const polls = await query .orderBy('poll.noteId', 'DESC') .limit(ps.limit) - .skip(ps.offset) + .offset(ps.offset) .getMany(); if (polls.length === 0) return []; diff --git a/packages/backend/src/server/api/endpoints/users.ts b/packages/backend/src/server/api/endpoints/users.ts index 2582932e3a..47d0a81552 100644 --- a/packages/backend/src/server/api/endpoints/users.ts +++ b/packages/backend/src/server/api/endpoints/users.ts @@ -81,7 +81,7 @@ export default class extends Endpoint { if (me) this.queryService.generateBlockQueryForUsers(query, me); query.limit(ps.limit); - query.skip(ps.offset); + query.offset(ps.offset); const users = await query.getMany(); diff --git a/packages/backend/src/server/api/endpoints/users/recommendation.ts b/packages/backend/src/server/api/endpoints/users/recommendation.ts index d39657059a..eebc5d14d5 100644 --- a/packages/backend/src/server/api/endpoints/users/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/users/recommendation.ts @@ -70,7 +70,7 @@ export default class extends Endpoint { query.setParameters(followingQuery.getParameters()); - const users = await query.limit(ps.limit).skip(ps.offset).getMany(); + const users = await query.limit(ps.limit).offset(ps.offset).getMany(); return await this.userEntityService.packMany(users, me, { detail: true }); }); diff --git a/packages/backend/src/server/api/endpoints/users/search.ts b/packages/backend/src/server/api/endpoints/users/search.ts index 1180de3611..836218ccd9 100644 --- a/packages/backend/src/server/api/endpoints/users/search.ts +++ b/packages/backend/src/server/api/endpoints/users/search.ts @@ -75,7 +75,7 @@ export default class extends Endpoint { users = await usernameQuery .orderBy('user.updatedAt', 'DESC', 'NULLS LAST') .limit(ps.limit) - .skip(ps.offset) + .offset(ps.offset) .getMany(); } else { const nameQuery = this.usersRepository.createQueryBuilder('user') @@ -102,7 +102,7 @@ export default class extends Endpoint { users = await nameQuery .orderBy('user.updatedAt', 'DESC', 'NULLS LAST') .limit(ps.limit) - .skip(ps.offset) + .offset(ps.offset) .getMany(); if (users.length < ps.limit) { @@ -128,7 +128,7 @@ export default class extends Endpoint { users = users.concat(await query .orderBy('user.updatedAt', 'DESC', 'NULLS LAST') .limit(ps.limit) - .skip(ps.offset) + .offset(ps.offset) .getMany(), ); } From 0404d9c103f32486b42adbea04324c4c05e5e514 Mon Sep 17 00:00:00 2001 From: Koki Takahashi Date: Tue, 25 Jul 2023 19:35:21 +0900 Subject: [PATCH 03/26] fix(backend): Change isPublic to correctly recognize as:Public term (#11347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Change isPublic to correctly recognize as:Public term * Update CHANGELOG.md --------- Co-authored-by: Acid Chicken (硫酸鶏) --- CHANGELOG.md | 2 +- packages/backend/src/core/activitypub/ApAudienceService.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 778438729c..744846d999 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ - ### Server -- +- Fix: 外部サーバーの投稿がタイムラインに表示されないことがある問題を修正 --> ## 13.x.x (unreleased) diff --git a/packages/backend/src/core/activitypub/ApAudienceService.ts b/packages/backend/src/core/activitypub/ApAudienceService.ts index a4ab5eae20..f2d84341f4 100644 --- a/packages/backend/src/core/activitypub/ApAudienceService.ts +++ b/packages/backend/src/core/activitypub/ApAudienceService.ts @@ -95,7 +95,7 @@ export class ApAudienceService { private isPublic(id: string): boolean { return [ 'https://www.w3.org/ns/activitystreams#Public', - 'as#Public', + 'as:Public', 'Public', ].includes(id); } From 81ba841fb8d2adf2d9fa7a68753daa93a3194778 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 25 Jul 2023 19:44:52 +0900 Subject: [PATCH 04/26] =?UTF-8?q?perf(frontend):=20MkMediaList=E3=81=AE?= =?UTF-8?q?=E3=82=A2=E3=82=B9=E3=83=9A=E3=82=AF=E3=83=88=E6=AF=94=E5=88=B6?= =?UTF-8?q?=E9=99=90=E3=82=92=E8=AA=BF=E6=95=B4=20(#11377)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/components/MkMediaList.vue | 63 +++++++++++++------ .../frontend/src/pages/settings/general.vue | 1 + 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/packages/frontend/src/components/MkMediaList.vue b/packages/frontend/src/components/MkMediaList.vue index be0aed6524..65d3d529dd 100644 --- a/packages/frontend/src/components/MkMediaList.vue +++ b/packages/frontend/src/components/MkMediaList.vue @@ -1,5 +1,5 @@