-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhance(backend): refine system account #15530
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #15530 +/- ##
===========================================
+ Coverage 42.14% 44.15% +2.00%
===========================================
Files 1609 1613 +4
Lines 162370 168364 +5994
Branches 4044 4098 +54
===========================================
+ Hits 68425 74333 +5908
- Misses 93472 93558 +86
Partials 473 473 ☔ View full report in Codecov by Sentry. |
たった1レコードのために全userレコードにフラグ持たせるの無駄すぎるからisRoot消してmetaに移動させた |
proxyアカウントのアイコンをサーバーアイコンにしたいけどサーバーアイコンはdriveFileとして存在していないからめんどいわね |
システムドライブ機能を先に実装する必要がある可能性が出てきた |
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -9666,10 +9666,7 @@
"type": "boolean"
},
"proxyAccountId": {
- "type": [
- "string",
- "null"
- ],
+ "type": "string",
"format": "id"
},
"email": {
@@ -17397,13 +17394,6 @@
"enableSensitiveMediaDetectionForVideos": {
"type": "boolean"
},
- "proxyAccountId": {
- "type": [
- "string",
- "null"
- ],
- "format": "misskey:id"
- },
"maintainerName": {
"type": [
"string",
@@ -17746,6 +17736,163 @@
},
"400": {
"description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/admin/update-proxy-account": {
+ "post": {
+ "operationId": "post___admin___update-proxy-account",
+ "summary": "admin/update-proxy-account",
+ "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:admin:account*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/admin/update-proxy-account.ts"
+ },
+ "tags": [
+ "admin"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "minLength": 1,
+ "maxLength": 1500
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OK (with results)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "$ref": "#/components/schemas/UserDetailed"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Client error",
"content": {
"application/json": {
"schema": { |
オッ |
ほぼ完成 |
これどうするかなぁ |
urlだけ設定するのでもいいけどurlが設定されているのにavatarIdがnullになっていると不具合起きそう |
Userをpackするときに上書きしてもいいけどいちいちプロキシかどうかチェックするのもな |
ファイル用のシステムアカウントを用意しても良いのかも? みたいな話はおさむさんがされてましたね…(しかし、本人とファイルの所有者が異なるとマズい? 良い感じに共用するみたいなことをしないといけない…?) |
ログ見ると
|
🙏🏻 🙏🏻 🙏🏻 🙏🏻 🙏🏻 |
うーんデッドロック |
#15005 かも |
あっいけた |
This reverts commit 266141f.
このPRで直すことではないのでrevert |
TASUKETE |
またデッドロックしてるっぽい |
#15574 では不十分だったか |
てかそもそもトランザクション使ってないのになんでデッドロックするんだ |
と思ったらまた通ったしこのPRが関係しているわけではなさそうだからマージする |
これ確認した? |
const _user = await this.usersRepository.findOneByOrFail({ id: user.id }); | ||
if (_user.isRoot) throw new Error('cannot delete a root account'); | ||
|
||
if (user.host === null && _user.username.includes('.')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
メモ:host === null で username.includes('.') なので、外部サーバーの . つきアカウント(brid.gyなど)に対する削除処理がうまくいかないとかは起こらない
ひとまずマージ |
🙏🏻 🙏🏻 🙏🏻 |
* wip * wip * wip * Update SystemAccountService.ts * Update 1740121393164-system-accounts.js * Update DeleteAccountService.ts * wip * wip * wip * wip * Update 1740121393164-system-accounts.js * Update RepositoryModule.ts * wip * wip * wip * Update ApRendererService.ts * wip * wip * Update SystemAccountService.ts * fix tests * fix tests * fix tests * fix tests * fix tests * fix tests * add print logs * ログが長すぎて出てないかもしれない * fix migration * refactor * fix fed-tests * Update RelayService.ts * merge * Update user.test.ts * chore: emit log * fix: tweak sleep duration * fix: exit 1 * fix: wait for misskey processes to become healthy * fix: longer sleep for user deletion * fix: make sleep longer again * デッドロック解消の試み misskey-dev#15005 * Revert "デッドロック解消の試み" This reverts commit 266141f. * wip * Update SystemAccountService.ts --------- Co-authored-by: おさむのひと <46447427+samunohito@users.noreply.github.com> Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>
* wip * wip * wip * Update SystemAccountService.ts * Update 1740121393164-system-accounts.js * Update DeleteAccountService.ts * wip * wip * wip * wip * Update 1740121393164-system-accounts.js * Update RepositoryModule.ts * wip * wip * wip * Update ApRendererService.ts * wip * wip * Update SystemAccountService.ts * fix tests * fix tests * fix tests * fix tests * fix tests * fix tests * add print logs * ログが長すぎて出てないかもしれない * fix migration * refactor * fix fed-tests * Update RelayService.ts * merge * Update user.test.ts * chore: emit log * fix: tweak sleep duration * fix: exit 1 * fix: wait for misskey processes to become healthy * fix: longer sleep for user deletion * fix: make sleep longer again * デッドロック解消の試み misskey-dev#15005 * Revert "デッドロック解消の試み" This reverts commit 266141f. * wip * Update SystemAccountService.ts --------- Co-authored-by: おさむのひと <46447427+samunohito@users.noreply.github.com> Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>
What
Fix #15525
Fix #14857
Why
Additional info (optional)
Fix #15011
Checklist