mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-14 05:15:35 +02:00
Merge branch 'develop' into renovate/major-backend-update-dependencies
This commit is contained in:
@@ -37,17 +37,17 @@
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@swc/core-android-arm64": "1.3.11",
|
||||
"@swc/core-darwin-arm64": "1.11.29",
|
||||
"@swc/core-darwin-x64": "1.11.29",
|
||||
"@swc/core-darwin-arm64": "1.12.0",
|
||||
"@swc/core-darwin-x64": "1.12.0",
|
||||
"@swc/core-freebsd-x64": "1.3.11",
|
||||
"@swc/core-linux-arm-gnueabihf": "1.11.29",
|
||||
"@swc/core-linux-arm64-gnu": "1.11.29",
|
||||
"@swc/core-linux-arm64-musl": "1.11.29",
|
||||
"@swc/core-linux-x64-gnu": "1.11.29",
|
||||
"@swc/core-linux-x64-musl": "1.11.29",
|
||||
"@swc/core-win32-arm64-msvc": "1.11.29",
|
||||
"@swc/core-win32-ia32-msvc": "1.11.29",
|
||||
"@swc/core-win32-x64-msvc": "1.11.29",
|
||||
"@swc/core-linux-arm-gnueabihf": "1.12.0",
|
||||
"@swc/core-linux-arm64-gnu": "1.12.0",
|
||||
"@swc/core-linux-arm64-musl": "1.12.0",
|
||||
"@swc/core-linux-x64-gnu": "1.12.0",
|
||||
"@swc/core-linux-x64-musl": "1.12.0",
|
||||
"@swc/core-win32-arm64-msvc": "1.12.0",
|
||||
"@swc/core-win32-ia32-msvc": "1.12.0",
|
||||
"@swc/core-win32-x64-msvc": "1.12.0",
|
||||
"@tensorflow/tfjs": "4.22.0",
|
||||
"@tensorflow/tfjs-node": "4.22.0",
|
||||
"bufferutil": "4.0.9",
|
||||
@@ -67,8 +67,8 @@
|
||||
"utf-8-validate": "6.0.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "3.817.0",
|
||||
"@aws-sdk/lib-storage": "3.817.0",
|
||||
"@aws-sdk/client-s3": "3.826.0",
|
||||
"@aws-sdk/lib-storage": "3.826.0",
|
||||
"@discordapp/twemoji": "15.1.0",
|
||||
"@fastify/accepts": "5.0.2",
|
||||
"@fastify/cookie": "11.0.2",
|
||||
@@ -80,10 +80,10 @@
|
||||
"@fastify/view": "11.1.0",
|
||||
"@misskey-dev/sharp-read-bmp": "1.2.0",
|
||||
"@misskey-dev/summaly": "5.2.1",
|
||||
"@napi-rs/canvas": "0.1.70",
|
||||
"@nestjs/common": "11.1.2",
|
||||
"@nestjs/core": "11.1.2",
|
||||
"@nestjs/testing": "11.1.2",
|
||||
"@napi-rs/canvas": "0.1.71",
|
||||
"@nestjs/common": "11.1.3",
|
||||
"@nestjs/core": "11.1.3",
|
||||
"@nestjs/testing": "11.1.3",
|
||||
"@peertube/http-signature": "1.7.0",
|
||||
"@sentry/node": "9.22.0",
|
||||
"@sentry/profiling-node": "9.22.0",
|
||||
@@ -91,7 +91,7 @@
|
||||
"@sinonjs/fake-timers": "14.0.0",
|
||||
"@smithy/node-http-handler": "4.0.5",
|
||||
"@swc/cli": "0.7.7",
|
||||
"@swc/core": "1.11.29",
|
||||
"@swc/core": "1.12.0",
|
||||
"@twemoji/parser": "16.0.0",
|
||||
"@types/redis-info": "3.0.3",
|
||||
"accepts": "1.3.8",
|
||||
@@ -101,7 +101,7 @@
|
||||
"bcryptjs": "3.0.2",
|
||||
"blurhash": "2.0.5",
|
||||
"body-parser": "2.2.0",
|
||||
"bullmq": "5.53.0",
|
||||
"bullmq": "5.53.2",
|
||||
"cacheable-lookup": "7.0.0",
|
||||
"cbor": "10.0.3",
|
||||
"chalk": "5.4.1",
|
||||
@@ -117,7 +117,7 @@
|
||||
"feed": "5.0.1",
|
||||
"file-type": "21.0.0",
|
||||
"fluent-ffmpeg": "2.1.3",
|
||||
"form-data": "4.0.2",
|
||||
"form-data": "4.0.3",
|
||||
"got": "14.4.7",
|
||||
"happy-dom": "17.4.7",
|
||||
"hpagent": "1.2.0",
|
||||
@@ -133,9 +133,9 @@
|
||||
"jsonld": "8.3.3",
|
||||
"jsrsasign": "11.1.0",
|
||||
"juice": "11.0.1",
|
||||
"meilisearch": "0.50.0",
|
||||
"meilisearch": "0.51.0",
|
||||
"mfm-js": "0.24.0",
|
||||
"microformats-parser": "2.0.2",
|
||||
"microformats-parser": "2.0.3",
|
||||
"mime-types": "3.0.1",
|
||||
"misskey-js": "workspace:*",
|
||||
"misskey-reversi": "workspace:*",
|
||||
@@ -187,15 +187,15 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "29.7.0",
|
||||
"@nestjs/platform-express": "11.1.2",
|
||||
"@sentry/vue": "9.22.0",
|
||||
"@nestjs/platform-express": "11.1.3",
|
||||
"@sentry/vue": "9.28.1",
|
||||
"@simplewebauthn/types": "12.0.0",
|
||||
"@swc/jest": "0.2.38",
|
||||
"@types/accepts": "1.3.7",
|
||||
"@types/archiver": "6.0.3",
|
||||
"@types/body-parser": "1.19.5",
|
||||
"@types/body-parser": "1.19.6",
|
||||
"@types/color-convert": "2.0.4",
|
||||
"@types/content-disposition": "0.5.8",
|
||||
"@types/content-disposition": "0.5.9",
|
||||
"@types/fluent-ffmpeg": "2.1.27",
|
||||
"@types/htmlescape": "1.1.3",
|
||||
"@types/http-link-header": "1.0.7",
|
||||
@@ -206,12 +206,12 @@
|
||||
"@types/jsrsasign": "10.5.15",
|
||||
"@types/mime-types": "2.1.4",
|
||||
"@types/ms": "2.1.0",
|
||||
"@types/node": "22.15.21",
|
||||
"@types/node": "22.15.31",
|
||||
"@types/nodemailer": "6.4.17",
|
||||
"@types/oauth": "0.9.6",
|
||||
"@types/oauth2orize": "1.11.5",
|
||||
"@types/oauth2orize-pkce": "0.1.2",
|
||||
"@types/pg": "8.15.2",
|
||||
"@types/pg": "8.15.4",
|
||||
"@types/pug": "2.0.10",
|
||||
"@types/qrcode": "1.5.5",
|
||||
"@types/random-seed": "0.3.5",
|
||||
@@ -227,8 +227,8 @@
|
||||
"@types/vary": "1.1.3",
|
||||
"@types/web-push": "3.6.4",
|
||||
"@types/ws": "8.18.1",
|
||||
"@typescript-eslint/eslint-plugin": "8.32.1",
|
||||
"@typescript-eslint/parser": "8.32.1",
|
||||
"@typescript-eslint/eslint-plugin": "8.34.0",
|
||||
"@typescript-eslint/parser": "8.34.0",
|
||||
"aws-sdk-client-mock": "4.1.0",
|
||||
"cross-env": "7.0.3",
|
||||
"eslint-plugin-import": "2.31.0",
|
||||
|
||||
@@ -331,6 +331,16 @@ export class ChatService {
|
||||
await redisPipeline.exec();
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async readAllChatMessages(
|
||||
readerId: MiUser['id'],
|
||||
): Promise<void> {
|
||||
const redisPipeline = this.redisClient.pipeline();
|
||||
// TODO: newUserChatMessageExists とか newRoomChatMessageExists も消したい(けどキーの列挙が必要になって面倒)
|
||||
redisPipeline.del(`newChatMessagesExists:${readerId}`);
|
||||
await redisPipeline.exec();
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public findMessageById(messageId: MiChatMessage['id']) {
|
||||
return this.chatMessagesRepository.findOneBy({ id: messageId });
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -482,9 +482,19 @@ export class ActivityPubServerService {
|
||||
return true;
|
||||
},
|
||||
dbFallback: async (untilId, sinceId, limit) => {
|
||||
return await this.getUserNotesFromDb(sinceId, untilId, limit, user.id);
|
||||
return await this.getUserNotesFromDb({
|
||||
untilId,
|
||||
sinceId,
|
||||
limit,
|
||||
userId: user.id,
|
||||
});
|
||||
},
|
||||
}) : await this.getUserNotesFromDb(sinceId ?? null, untilId ?? null, limit, user.id);
|
||||
}) : await this.getUserNotesFromDb({
|
||||
untilId: untilId ?? null,
|
||||
sinceId: sinceId ?? null,
|
||||
limit,
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
if (sinceId) notes.reverse();
|
||||
|
||||
@@ -523,16 +533,21 @@ export class ActivityPubServerService {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async getUserNotesFromDb(untilId: string | null, sinceId: string | null, limit: number, userId: MiUser['id']) {
|
||||
return await this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), sinceId, untilId)
|
||||
.andWhere('note.userId = :userId', { userId })
|
||||
private async getUserNotesFromDb(ps: {
|
||||
untilId: string | null,
|
||||
sinceId: string | null,
|
||||
limit: number,
|
||||
userId: MiUser['id'],
|
||||
}) {
|
||||
return await this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId)
|
||||
.andWhere('note.userId = :userId', { userId: ps.userId })
|
||||
.andWhere(new Brackets(qb => {
|
||||
qb
|
||||
.where('note.visibility = \'public\'')
|
||||
.orWhere('note.visibility = \'home\'');
|
||||
}))
|
||||
.andWhere('note.localOnly = FALSE')
|
||||
.limit(limit)
|
||||
.limit(ps.limit)
|
||||
.getMany();
|
||||
}
|
||||
|
||||
|
||||
@@ -428,4 +428,5 @@ export * as 'chat/rooms/invitations/ignore' from './endpoints/chat/rooms/invitat
|
||||
export * as 'chat/rooms/invitations/inbox' from './endpoints/chat/rooms/invitations/inbox.js';
|
||||
export * as 'chat/rooms/invitations/outbox' from './endpoints/chat/rooms/invitations/outbox.js';
|
||||
export * as 'chat/history' from './endpoints/chat/history.js';
|
||||
export * as 'chat/read-all' from './endpoints/chat/read-all.js';
|
||||
export * as 'v2/admin/emoji/list' from './endpoints/v2/admin/emoji/list.js';
|
||||
|
||||
38
packages/backend/src/server/api/endpoints/chat/read-all.ts
Normal file
38
packages/backend/src/server/api/endpoints/chat/read-all.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { ChatService } from '@/core/ChatService.js';
|
||||
import { ApiError } from '@/server/api/error.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['chat'],
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:chat',
|
||||
|
||||
errors: {
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
},
|
||||
} as const;
|
||||
|
||||
@Injectable()
|
||||
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
|
||||
constructor(
|
||||
private chatService: ChatService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
await this.chatService.readAllChatMessages(me.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user