feat: アンテナから特定のノートを手動で除去できるように#17463
Open
samunohito wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #17463 +/- ##
===========================================
- Coverage 25.31% 25.29% -0.02%
===========================================
Files 1160 1161 +1
Lines 39643 39671 +28
Branches 11010 11018 +8
===========================================
Hits 10036 10036
- Misses 23729 23749 +20
- Partials 5878 5886 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Backend memory usage comparisonBefore GC
After GC
After Request
|
Contributor
|
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -21287,6 +21287,168 @@
}
}
},
+ "/antennas/remove-note": {
+ "post": {
+ "operationId": "post___antennas___remove-note",
+ "summary": "antennas/remove-note",
+ "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:account*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/antennas/remove-note.ts"
+ },
+ "tags": [
+ "antennas"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "antennaId": {
+ "type": "string",
+ "format": "misskey:id"
+ },
+ "noteId": {
+ "type": "string",
+ "format": "misskey:id"
+ }
+ },
+ "required": [
+ "antennaId",
+ "noteId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "204": {
+ "description": "OK (without any results)"
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "NO_SUCH_ANTENNA": {
+ "value": {
+ "error": {
+ "message": "No such antenna.",
+ "code": "NO_SUCH_ANTENNA",
+ "id": "850926e0-fd3b-49b6-b69a-b28a5dbd82fe"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/antennas/show": {
"post": {
"operationId": "post___antennas___show", |
| }); | ||
| } | ||
|
|
||
| if (props.currentAntenna != null && appearNote.userId !== $i.id && !$i.isModerator && !$i.isAdmin) { |
Contributor
There was a problem hiding this comment.
条件がややこしくて一瞬L519-L526と重複に見えた
else if では無理そう?
Member
Author
There was a problem hiding this comment.
off-topic:
なんかもうこのファイルが全体的にカオスなので、ごそっと整理したい気持ちも…
const isMyNote = appearNote.userId === $i.id;
const isModerator = $i.isModerator || $i.isAdmin;みたいなのを作って、同じ条件を置き換えるだけでも認知負荷が下がりそうな予感
Member
Author
There was a problem hiding this comment.
あと、unit-testを書いてもいいかもしれない
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
アンテナからノートを消せるようにします。
Why
fix #15391
Additional info (optional)
ローカルで動確済み
Checklist