From 416da28dc39c8b25510a4f4c5c98dc1d902f378c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Mon, 1 Apr 2024 23:18:58 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix(backend):=20Skeb=E9=80=A3=E6=90=BA?= =?UTF-8?q?=E3=81=AE=E7=85=A7=E4=BC=9A=E5=BE=8C=E3=83=AD=E3=83=BC=E3=83=AB?= =?UTF-8?q?=E4=BB=98=E4=B8=8E=E3=81=AB=E5=A4=B1=E6=95=97=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=82=82=E7=84=A1=E8=A6=96=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/endpoints/users/get-skeb-status.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/users/get-skeb-status.ts b/packages/backend/src/server/api/endpoints/users/get-skeb-status.ts index f2e1036651..87782539d7 100644 --- a/packages/backend/src/server/api/endpoints/users/get-skeb-status.ts +++ b/packages/backend/src/server/api/endpoints/users/get-skeb-status.ts @@ -134,16 +134,24 @@ export default class extends Endpoint { // eslint- if (res.status > 299 || (json.error ?? json.ban_reason)) { logger.error('Skeb status response error', { url: url.href, userId: ps.userId, status: res.status, statusText: res.statusText, error: json.error ?? json.ban_reason }); - if (res.status === 404 && hasSkebRole) await this.roleService.unassign(ps.userId, this.config.skebStatus.roleId); + try { + if (res.status === 404 && hasSkebRole) await this.roleService.unassign(ps.userId, this.config.skebStatus.roleId); + } catch (err) { + logger.error('Failed to unassign role', { userId: ps.userId, roleId: this.config.skebStatus.roleId, error: err }); + } throw new ApiError(meta.errors.noSuchUser); } logger.info('Skeb status response', { url: url.href, userId: ps.userId, status: res.status, statusText: res.statusText, skebStatus: json }); - if (json.is_acceptable) { - if (!hasSkebRole) await this.roleService.assign(ps.userId, this.config.skebStatus.roleId); - } else if (hasSkebRole) { - await this.roleService.unassign(ps.userId, this.config.skebStatus.roleId); + try { + if (json.is_acceptable) { + if (!hasSkebRole) await this.roleService.assign(ps.userId, this.config.skebStatus.roleId); + } else if (hasSkebRole) { + await this.roleService.unassign(ps.userId, this.config.skebStatus.roleId); + } + } catch (err) { + logger.error('Failed to assign/unassign role', { userId: ps.userId, roleId: this.config.skebStatus.roleId, error: err }); } return { From e002ffc0cf3d16ffd58793f36914fd309d0b797d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Mon, 1 Apr 2024 23:20:11 +0900 Subject: [PATCH 2/2] Bump up version to 2024.3.1-io.5a --- package.json | 2 +- packages/misskey-js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 93e779d7df..1719d96a3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2024.3.1-io.5", + "version": "2024.3.1-io.5a", "codename": "nasubi", "repository": { "type": "git", diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index 39e33544b8..72b3760ffd 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "misskey-js", - "version": "2024.3.1-io.5", + "version": "2024.3.1-io.5a", "description": "Misskey SDK for JavaScript", "types": "./built/dts/index.d.ts", "exports": {