diff --git a/CHANGELOG.md b/CHANGELOG.md index 73d3a5842..ac28c4a2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ You should also include the user name that made the change. ### Improvements - Client: Add following badge to user preview popup @nvisser +### Bugfixes +- Server: 他人の通知を既読にできる可能性があるのを修正 @syuilo + ## 12.118.1 (2022/08/08) ### Bugfixes diff --git a/packages/backend/package.json b/packages/backend/package.json index 1393f1d51..be1b8ab46 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -10,8 +10,12 @@ "build": "tsc -p tsconfig.json || echo done. && tsc-alias -p tsconfig.json", "watch": "node watch.mjs", "lint": "eslint --quiet \"src/**/*.ts\"", - "mocha": "NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", - "test": "yarn mocha" + "mocha": "cross-env NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", + "test": "npm run mocha" + }, + "resolutions": { + "chokidar": "^3.3.1", + "lodash": "^4.17.21" }, "optionalDependencies": { "@tensorflow/tfjs-node": "3.20.0" @@ -113,7 +117,7 @@ "tsc-alias": "1.7.0", "tsconfig-paths": "4.1.0", "twemoji-parser": "14.0.0", - "typeorm": "^0.3.9", + "typeorm": "0.3.9", "ulid": "2.3.0", "unzipper": "0.10.11", "uuid": "8.3.2", diff --git a/packages/backend/src/server/api/common/read-notification.ts b/packages/backend/src/server/api/common/read-notification.ts index cf993ade3..b0d38a9e3 100644 --- a/packages/backend/src/server/api/common/read-notification.ts +++ b/packages/backend/src/server/api/common/read-notification.ts @@ -1,18 +1,19 @@ +import { In } from 'typeorm'; import { publishMainStream } from '@/services/stream.js'; import { pushNotification } from '@/services/push-notification.js'; import { User } from '@/models/entities/user.js'; import { Notification } from '@/models/entities/notification.js'; import { Notifications, Users } from '@/models/index.js'; -import { In } from 'typeorm'; export async function readNotification( userId: User['id'], - notificationIds: Notification['id'][] + notificationIds: Notification['id'][], ) { if (notificationIds.length === 0) return; // Update documents const result = await Notifications.update({ + notifieeId: userId, id: In(notificationIds), isRead: false, }, { @@ -27,7 +28,7 @@ export async function readNotification( export async function readNotificationByQuery( userId: User['id'], - query: Record + query: Record, ) { const notificationIds = await Notifications.findBy({ ...query, diff --git a/packages/client/src/components/MkAbuseReport.vue b/packages/client/src/components/MkAbuseReport.vue index 42bd1af3f..9a3464b64 100644 --- a/packages/client/src/components/MkAbuseReport.vue +++ b/packages/client/src/components/MkAbuseReport.vue @@ -36,7 +36,7 @@