Skip to content

Commit 25ba5ce

Browse files
committed
Merge branch 'develop' into fix-htl-stream
2 parents a02ec21 + 39d6af1 commit 25ba5ce

23 files changed

+1244
-1029
lines changed

CHANGELOG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
## 202x.x.x (unreleased)
1515

1616
### General
17-
- 通知がミュート、凍結を考慮するようになりました
17+
- Enhance: 通知がミュート、凍結を考慮するようになりました
1818
- Enhance: サーバーごとにモデレーションノートを残せるように
1919
- Enhance: コンディショナルロールの条件に「マニュアルロールへのアサイン」を追加
2020
- Enhance: 通知の受信設定に「フォロー中またはフォロワー」を追加
21+
- Enhance: 通知の履歴をリセットできるように
2122
- Fix: ダイレクトなノートに対してはダイレクトでしか返信できないように
2223

2324
### Client
@@ -38,7 +39,7 @@
3839
- Fix: 禁止キーワードを含むノートがDelayed Queueに追加されて再処理される問題を修正
3940
- Fix: 自分がフォローしていないアカウントのフォロワー限定ノートが閲覧できることがある問題を修正
4041
- Fix: タイムラインのオプションで「リノートを表示」を無効にしている際、投票のみの引用リノートが流れてこない問題を修正
41-
- エンドポイント`admin/emoji/update`の各種修正
42+
- Fix: エンドポイント`admin/emoji/update`の各種修正
4243
- 必須パラメータを`id`または`name`のいずれかのみに
4344
- `id`の代わりに`name`で絵文字を指定可能に(`id``name`両指定時は従来通り`name`を変更する挙動)
4445
- `category`および`licence`が指定なしの時勝手にnullに上書きされる挙動を修正

locales/index.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -8913,6 +8913,10 @@ export interface Locale extends ILocale {
89138913
* {n}人にフォローされました
89148914
*/
89158915
"followedBySomeUsers": ParameterizedString<"n">;
8916+
/**
8917+
* 通知の履歴をリセットする
8918+
*/
8919+
"flushNotification": string;
89168920
"_types": {
89178921
/**
89188922
* すべて

locales/ja-JP.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2356,6 +2356,7 @@ _notification:
23562356
reactedBySomeUsers: "{n}人がリアクションしました"
23572357
renotedBySomeUsers: "{n}人がリノートしました"
23582358
followedBySomeUsers: "{n}人にフォローされました"
2359+
flushNotification: "通知の履歴をリセットする"
23592360

23602361
_types:
23612362
all: "すべて"

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,21 @@
4848
"lodash": "4.17.21"
4949
},
5050
"dependencies": {
51-
"cssnano": "6.0.3",
51+
"cssnano": "6.0.5",
5252
"execa": "8.0.1",
5353
"fast-glob": "3.3.2",
5454
"ignore-walk": "6.0.4",
5555
"js-yaml": "4.1.0",
56-
"postcss": "8.4.33",
56+
"postcss": "8.4.35",
5757
"tar": "6.2.0",
58-
"terser": "5.27.0",
58+
"terser": "5.28.1",
5959
"typescript": "5.3.3"
6060
},
6161
"devDependencies": {
6262
"@typescript-eslint/eslint-plugin": "6.18.1",
6363
"@typescript-eslint/parser": "6.18.1",
6464
"cross-env": "7.0.3",
65-
"cypress": "13.6.3",
65+
"cypress": "13.6.6",
6666
"eslint": "8.56.0",
6767
"ncp": "2.0.0",
6868
"start-server-and-test": "2.0.3"

packages/backend/package.json

+23-23
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
"dependencies": {
6868
"@aws-sdk/client-s3": "3.412.0",
6969
"@aws-sdk/lib-storage": "3.412.0",
70-
"@bull-board/api": "5.14.0",
71-
"@bull-board/fastify": "5.14.0",
72-
"@bull-board/ui": "5.14.0",
70+
"@bull-board/api": "5.14.2",
71+
"@bull-board/fastify": "5.14.2",
72+
"@bull-board/ui": "5.14.2",
7373
"@discordapp/twemoji": "15.0.2",
7474
"@fastify/accepts": "4.3.0",
7575
"@fastify/cookie": "9.3.1",
@@ -79,13 +79,13 @@
7979
"@fastify/multipart": "8.1.0",
8080
"@fastify/static": "6.12.0",
8181
"@fastify/view": "8.2.0",
82-
"@misskey-dev/sharp-read-bmp": "^1.2.0",
83-
"@misskey-dev/summaly": "^5.0.3",
82+
"@misskey-dev/sharp-read-bmp": "1.2.0",
83+
"@misskey-dev/summaly": "5.0.3",
8484
"@nestjs/common": "10.2.10",
8585
"@nestjs/core": "10.2.10",
8686
"@nestjs/testing": "10.2.10",
8787
"@peertube/http-signature": "1.7.0",
88-
"@simplewebauthn/server": "9.0.2",
88+
"@simplewebauthn/server": "9.0.3",
8989
"@sinonjs/fake-timers": "11.2.2",
9090
"@smithy/node-http-handler": "2.1.10",
9191
"@swc/cli": "0.1.63",
@@ -98,7 +98,7 @@
9898
"bcryptjs": "2.4.3",
9999
"blurhash": "2.0.5",
100100
"body-parser": "1.20.2",
101-
"bullmq": "5.1.9",
101+
"bullmq": "5.4.0",
102102
"cacheable-lookup": "7.0.0",
103103
"cbor": "9.0.2",
104104
"chalk": "5.3.0",
@@ -115,11 +115,11 @@
115115
"file-type": "19.0.0",
116116
"fluent-ffmpeg": "2.1.2",
117117
"form-data": "4.0.0",
118-
"got": "14.1.0",
118+
"got": "14.2.0",
119119
"happy-dom": "10.0.3",
120120
"hpagent": "1.2.0",
121-
"htmlescape": "^1.1.1",
122-
"http-link-header": "1.1.1",
121+
"htmlescape": "1.1.1",
122+
"http-link-header": "1.1.2",
123123
"ioredis": "5.3.2",
124124
"ip-cidr": "3.1.0",
125125
"ipaddr.js": "2.1.0",
@@ -128,18 +128,18 @@
128128
"jsdom": "23.2.0",
129129
"json5": "2.2.3",
130130
"jsonld": "8.3.2",
131-
"jsrsasign": "11.0.0",
131+
"jsrsasign": "11.1.0",
132132
"meilisearch": "0.37.0",
133133
"mfm-js": "0.24.0",
134134
"microformats-parser": "2.0.2",
135135
"mime-types": "2.1.35",
136136
"misskey-js": "workspace:*",
137137
"misskey-reversi": "workspace:*",
138138
"ms": "3.0.0-canary.1",
139-
"nanoid": "5.0.4",
139+
"nanoid": "5.0.6",
140140
"nested-property": "4.0.0",
141141
"node-fetch": "3.3.2",
142-
"nodemailer": "6.9.8",
142+
"nodemailer": "6.9.10",
143143
"nsfwjs": "2.4.2",
144144
"oauth": "0.10.0",
145145
"oauth2orize": "1.12.0",
@@ -163,15 +163,15 @@
163163
"rename": "1.0.4",
164164
"rss-parser": "3.13.0",
165165
"rxjs": "7.8.1",
166-
"sanitize-html": "2.11.0",
166+
"sanitize-html": "2.12.1",
167167
"secure-json-parse": "2.7.0",
168168
"sharp": "0.33.2",
169169
"slacc": "0.0.10",
170170
"strict-event-emitter-types": "2.0.0",
171171
"stringz": "2.1.0",
172-
"systeminformation": "5.21.24",
172+
"systeminformation": "5.22.0",
173173
"tinycolor2": "1.6.0",
174-
"tmp": "0.2.1",
174+
"tmp": "0.2.2",
175175
"tsc-alias": "1.8.8",
176176
"tsconfig-paths": "4.2.0",
177177
"typeorm": "0.3.20",
@@ -185,7 +185,7 @@
185185
"devDependencies": {
186186
"@jest/globals": "29.7.0",
187187
"@misskey-dev/eslint-plugin": "1.0.0",
188-
"@nestjs/platform-express": "10.3.1",
188+
"@nestjs/platform-express": "10.3.3",
189189
"@simplewebauthn/types": "9.0.1",
190190
"@swc/jest": "0.2.31",
191191
"@types/accepts": "1.3.7",
@@ -204,21 +204,21 @@
204204
"@types/jsrsasign": "10.5.12",
205205
"@types/mime-types": "2.1.4",
206206
"@types/ms": "0.7.34",
207-
"@types/node": "20.11.17",
207+
"@types/node": "20.11.22",
208208
"@types/node-fetch": "3.0.3",
209209
"@types/nodemailer": "6.4.14",
210210
"@types/oauth": "0.9.4",
211211
"@types/oauth2orize": "1.11.3",
212212
"@types/oauth2orize-pkce": "0.1.2",
213-
"@types/pg": "8.11.0",
213+
"@types/pg": "8.11.2",
214214
"@types/pug": "2.0.10",
215-
"@types/punycode": "2.1.3",
215+
"@types/punycode": "2.1.4",
216216
"@types/qrcode": "1.5.5",
217217
"@types/random-seed": "0.3.5",
218218
"@types/ratelimiter": "3.4.6",
219219
"@types/rename": "1.0.7",
220-
"@types/sanitize-html": "2.9.5",
221-
"@types/semver": "7.5.6",
220+
"@types/sanitize-html": "2.11.0",
221+
"@types/semver": "7.5.8",
222222
"@types/simple-oauth2": "5.0.7",
223223
"@types/sinonjs__fake-timers": "8.1.5",
224224
"@types/tinycolor2": "1.4.6",
@@ -236,7 +236,7 @@
236236
"fkill": "^9.0.0",
237237
"jest": "29.7.0",
238238
"jest-mock": "29.7.0",
239-
"nodemon": "3.0.3",
239+
"nodemon": "3.1.0",
240240
"pid-port": "1.0.0",
241241
"simple-oauth2": "5.0.0"
242242
}

packages/backend/src/core/GlobalEventService.ts

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export interface MainEventTypes {
6969
file: Packed<'DriveFile'>;
7070
};
7171
readAllNotifications: undefined;
72+
notificationFlushed: undefined;
7273
unreadNotification: Packed<'Notification'>;
7374
unreadMention: MiNote['id'];
7475
readAllUnreadMentions: undefined;

packages/backend/src/core/NotificationService.ts

+9
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,15 @@ export class NotificationService implements OnApplicationShutdown {
214214
*/
215215
}
216216

217+
@bindThis
218+
public async flushAllNotifications(userId: MiUser['id']) {
219+
await Promise.all([
220+
this.redisClient.del(`notificationTimeline:${userId}`),
221+
this.redisClient.del(`latestReadNotification:${userId}`),
222+
]);
223+
this.globalEventService.publishMainStream(userId, 'notificationFlushed');
224+
}
225+
217226
@bindThis
218227
public dispose(): void {
219228
this.#shutdownController.abort();

packages/backend/src/core/WebAuthnService.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class WebAuthnService {
191191
if (cert[0] === 0x04) { // 前の実装ではいつも 0x04 で始まっていた
192192
const halfLength = (cert.length - 1) / 2;
193193

194-
const cborMap = new Map<number, number | ArrayBufferLike>();
194+
const cborMap = new Map<number, number | Uint8Array>();
195195
cborMap.set(1, 2); // kty, EC2
196196
cborMap.set(3, -7); // alg, ES256
197197
cborMap.set(-1, 1); // crv, P256

packages/backend/src/server/api/EndpointsModule.ts

+5
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ import * as ep___notes_translate from './endpoints/notes/translate.js';
293293
import * as ep___notes_unrenote from './endpoints/notes/unrenote.js';
294294
import * as ep___notes_userListTimeline from './endpoints/notes/user-list-timeline.js';
295295
import * as ep___notifications_create from './endpoints/notifications/create.js';
296+
import * as ep___notifications_flush from './endpoints/notifications/flush.js';
296297
import * as ep___notifications_markAllAsRead from './endpoints/notifications/mark-all-as-read.js';
297298
import * as ep___notifications_testNotification from './endpoints/notifications/test-notification.js';
298299
import * as ep___pagePush from './endpoints/page-push.js';
@@ -664,6 +665,7 @@ const $notes_translate: Provider = { provide: 'ep:notes/translate', useClass: ep
664665
const $notes_unrenote: Provider = { provide: 'ep:notes/unrenote', useClass: ep___notes_unrenote.default };
665666
const $notes_userListTimeline: Provider = { provide: 'ep:notes/user-list-timeline', useClass: ep___notes_userListTimeline.default };
666667
const $notifications_create: Provider = { provide: 'ep:notifications/create', useClass: ep___notifications_create.default };
668+
const $notifications_flush: Provider = { provide: 'ep:notifications/flush', useClass: ep___notifications_flush.default };
667669
const $notifications_markAllAsRead: Provider = { provide: 'ep:notifications/mark-all-as-read', useClass: ep___notifications_markAllAsRead.default };
668670
const $notifications_testNotification: Provider = { provide: 'ep:notifications/test-notification', useClass: ep___notifications_testNotification.default };
669671
const $pagePush: Provider = { provide: 'ep:page-push', useClass: ep___pagePush.default };
@@ -1039,6 +1041,7 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__
10391041
$notes_unrenote,
10401042
$notes_userListTimeline,
10411043
$notifications_create,
1044+
$notifications_flush,
10421045
$notifications_markAllAsRead,
10431046
$notifications_testNotification,
10441047
$pagePush,
@@ -1408,7 +1411,9 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__
14081411
$notes_unrenote,
14091412
$notes_userListTimeline,
14101413
$notifications_create,
1414+
$notifications_flush,
14111415
$notifications_markAllAsRead,
1416+
$notifications_testNotification,
14121417
$pagePush,
14131418
$pages_create,
14141419
$pages_delete,

packages/backend/src/server/api/endpoints.ts

+2
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ import * as ep___notes_translate from './endpoints/notes/translate.js';
293293
import * as ep___notes_unrenote from './endpoints/notes/unrenote.js';
294294
import * as ep___notes_userListTimeline from './endpoints/notes/user-list-timeline.js';
295295
import * as ep___notifications_create from './endpoints/notifications/create.js';
296+
import * as ep___notifications_flush from './endpoints/notifications/flush.js';
296297
import * as ep___notifications_markAllAsRead from './endpoints/notifications/mark-all-as-read.js';
297298
import * as ep___notifications_testNotification from './endpoints/notifications/test-notification.js';
298299
import * as ep___pagePush from './endpoints/page-push.js';
@@ -662,6 +663,7 @@ const eps = [
662663
['notes/unrenote', ep___notes_unrenote],
663664
['notes/user-list-timeline', ep___notes_userListTimeline],
664665
['notifications/create', ep___notifications_create],
666+
['notifications/flush', ep___notifications_flush],
665667
['notifications/mark-all-as-read', ep___notifications_markAllAsRead],
666668
['notifications/test-notification', ep___notifications_testNotification],
667669
['page-push', ep___pagePush],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* SPDX-FileCopyrightText: syuilo and misskey-project
3+
* SPDX-License-Identifier: AGPL-3.0-only
4+
*/
5+
6+
import { Injectable } from '@nestjs/common';
7+
import { Endpoint } from '@/server/api/endpoint-base.js';
8+
import { NotificationService } from '@/core/NotificationService.js';
9+
10+
export const meta = {
11+
tags: ['notifications', 'account'],
12+
13+
requireCredential: true,
14+
15+
kind: 'write:notifications',
16+
} as const;
17+
18+
export const paramDef = {
19+
type: 'object',
20+
properties: {},
21+
required: [],
22+
} as const;
23+
24+
@Injectable()
25+
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
26+
constructor(
27+
private notificationService: NotificationService,
28+
) {
29+
super(meta, paramDef, async (ps, me) => {
30+
this.notificationService.flushAllNotifications(me.id);
31+
});
32+
}
33+
}

0 commit comments

Comments
 (0)