From e10ce7204cf54408d533f5f716f4d6a98aed86ed Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Wed, 21 Feb 2024 20:15:04 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20MkUserPopup=E3=81=8C=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=A6=E3=82=8B=E7=8A=B6=E6=85=8B?= =?UTF-8?q?=E3=81=A7v-user-preview=E3=81=8C=E3=81=A4=E3=81=84=E3=81=9F?= =?UTF-8?q?=E8=A6=81=E7=B4=A0=E3=81=8Cdetach=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=81=A8MkUserPopup=E3=81=8C=E6=B6=88=E3=81=88=E3=81=AA?= =?UTF-8?q?=E3=81=84=E5=95=8F=E9=A1=8C=20(#13349)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: MkUserPopupが表示されてる状態でv-user-previewがついた要素がdetachされるとMkUserPopupが消えない問題 * docs(changelog): previewの中のユーザメンションをホバーした状態で投稿を編集するとユーザの情報popupが消えない問題を修正 * docs(changelog): ユーザの情報のポップアップが消えなくなることがある問題を修正 --- CHANGELOG.md | 1 + packages/frontend/src/directives/user-preview.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1de194da1..027f05c922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,7 @@ - Fix: エラー画像URLを設定した後解除すると,デフォルトの画像が表示されない問題の修正 - Fix: MkCodeEditorで行がずれていってしまう問題の修正 - Fix: Summaly proxy利用時にプレイヤーが動作しないことがあるのを修正 #13196 +- Fix: ユーザの情報のポップアップが消えなくなることがある問題を修正 ### Server - Enhance: 連合先のレートリミットを超過した際にリトライするようになりました diff --git a/packages/frontend/src/directives/user-preview.ts b/packages/frontend/src/directives/user-preview.ts index 0d6c330da1..7a008a4486 100644 --- a/packages/frontend/src/directives/user-preview.ts +++ b/packages/frontend/src/directives/user-preview.ts @@ -99,7 +99,6 @@ export class UserPreview { this.el.removeEventListener('mouseover', this.onMouseover); this.el.removeEventListener('mouseleave', this.onMouseleave); this.el.removeEventListener('click', this.onClick); - window.clearInterval(this.checkTimer); } } From b36e6b1a777848ec8553b297e956ada240dcacc9 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Thu, 22 Feb 2024 00:59:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E7=A6=81=E6=AD=A2=E3=82=AD=E3=83=BC?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=89=E3=82=92=E5=90=AB=E3=82=80=E3=83=8E?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=8CDelayed=20Queue=E3=81=AB=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=81=95=E3=82=8C=E3=81=A6=E5=86=8D=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=82=8B=E5=95=8F=E9=A1=8C=20(#13428)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: use IdentifiableError instead of NoteCreateService.ContainsProhibitedWordsError * fix: notes with prohibited words are reprocessed with delay * docs(changelog): 禁止キーワードを含むノートがDelayed Queueに追加されて再処理される問題 * lint: fix lint errors * fix: rethrowするべきなのにrethrowし忘れていたのを修正 --- CHANGELOG.md | 1 + packages/backend/src/core/NoteCreateService.ts | 5 ++--- .../src/queue/processors/InboxProcessorService.ts | 10 +++++++++- .../backend/src/server/api/endpoints/notes/create.ts | 5 +++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 027f05c922..63f5c913f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ ### Server - Fix: nodeinfoにenableMcaptchaとenableTurnstileが無いのを修正 +- Fix: 禁止キーワードを含むノートがDelayed Queueに追加されて再処理される問題を修正 ## 2024.2.0 diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 9cec614d5c..2a5fd2e1a6 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -59,6 +59,7 @@ import { UtilityService } from '@/core/UtilityService.js'; import { UserBlockingService } from '@/core/UserBlockingService.js'; import { isReply } from '@/misc/is-reply.js'; import { trackPromise } from '@/misc/promise-tracker.js'; +import { IdentifiableError } from '@/misc/identifiable-error.js'; type NotificationType = 'reply' | 'renote' | 'quote' | 'mention'; @@ -151,8 +152,6 @@ type Option = { export class NoteCreateService implements OnApplicationShutdown { #shutdownController = new AbortController(); - public static ContainsProhibitedWordsError = class extends Error {}; - constructor( @Inject(DI.config) private config: Config, @@ -264,7 +263,7 @@ export class NoteCreateService implements OnApplicationShutdown { } if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', meta.prohibitedWords)) { - throw new NoteCreateService.ContainsProhibitedWordsError(); + throw new IdentifiableError('689ee33f-f97c-479a-ac49-1b9f8140af99', 'Note contains prohibited words'); } const inSilencedInstance = this.utilityService.isSilencedHost(meta.silencedHosts, user.host); diff --git a/packages/backend/src/queue/processors/InboxProcessorService.ts b/packages/backend/src/queue/processors/InboxProcessorService.ts index 7adadd799b..0a713149e5 100644 --- a/packages/backend/src/queue/processors/InboxProcessorService.ts +++ b/packages/backend/src/queue/processors/InboxProcessorService.ts @@ -24,6 +24,7 @@ import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js'; import { LdSignatureService } from '@/core/activitypub/LdSignatureService.js'; import { ApInboxService } from '@/core/activitypub/ApInboxService.js'; import { bindThis } from '@/decorators.js'; +import { IdentifiableError } from '@/misc/identifiable-error.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type { InboxJobData } from '../types.js'; @@ -180,7 +181,14 @@ export class InboxProcessorService { }); // アクティビティを処理 - await this.apInboxService.performActivity(authUser.user, activity); + try { + await this.apInboxService.performActivity(authUser.user, activity); + } catch (e) { + if (e instanceof IdentifiableError) { + if (e.id === '689ee33f-f97c-479a-ac49-1b9f8140af99') return 'blocked notes with prohibited words'; + } + throw e; + } return 'ok'; } } diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index e6e4fcc745..2fa0bd099f 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -19,6 +19,7 @@ import { DI } from '@/di-symbols.js'; import { isPureRenote } from '@/misc/is-pure-renote.js'; import { MetaService } from '@/core/MetaService.js'; import { UtilityService } from '@/core/UtilityService.js'; +import { IdentifiableError } from '@/misc/identifiable-error.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -376,8 +377,8 @@ export default class extends Endpoint { // eslint- }; } catch (e) { // TODO: 他のErrorもここでキャッチしてエラーメッセージを当てるようにしたい - if (e instanceof NoteCreateService.ContainsProhibitedWordsError) { - throw new ApiError(meta.errors.containsProhibitedWords); + if (e instanceof IdentifiableError) { + if (e.id === '689ee33f-f97c-479a-ac49-1b9f8140af99') throw new ApiError(meta.errors.containsProhibitedWords); } throw e;