Skip to content
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

リモートクリップのお気に入り登録 #438

Merged
merged 4 commits into from
Sep 14, 2024

Conversation

kozakura913
Copy link
Collaborator

What

リモートのクリップをお気に入りに登録できるようにした。
clips/my-favoritesのオプションでローカルのみ、リモートのみに絞る事もできる

Why

resolve: #296

Additional info (optional)

デフォルト設定だとclips/my-favorites呼ばれるたびに2回DB読んでるから速度は悪そう

Checklist

  • コントリビューションガイドを読みました( Read the contribution guide)
  • ローカル環境で動作しました(Test working in a local environment)
  • (必要なら)CHANGELOG_YOJO.mdの更新((If needed) Update CHANGELOG_YOJO.md)
  • (必要なら)テストの追加((If possible) Add tests)

Copy link

codecov bot commented Sep 14, 2024

Codecov Report

Attention: Patch coverage is 35.41667% with 155 lines in your changes missing coverage. Please review.

Project coverage is 40.49%. Comparing base (641c923) to head (2661a13).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
packages/backend/src/core/ClipService.ts 20.23% 67 Missing ⚠️
...backend/src/server/api/endpoints/clips/favorite.ts 18.91% 30 Missing ⚠️
...end/src/server/api/endpoints/clips/my-favorites.ts 19.23% 21 Missing ⚠️
...ges/backend/src/server/api/endpoints/clips/show.ts 9.52% 19 Missing ⚠️
...ckend/src/server/api/endpoints/clips/unfavorite.ts 10.00% 18 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop     #438       +/-   ##
============================================
+ Coverage    20.21%   40.49%   +20.28%     
============================================
  Files          787     1665      +878     
  Lines       117146   223792   +106646     
  Branches      1088     2936     +1848     
============================================
+ Hits         23676    90616    +66940     
- Misses       92882   132567    +39685     
- Partials       588      609       +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

이 PR에 의한 api.json 차이

차이점은 여기에서 볼 수 있음
--- base
+++ head
@@ -29990,6 +29990,15 @@
                       }
                     }
                   },
+                  "FAILED_TO_RESOLVE_REMOTE_USER": {
+                    "value": {
+                      "error": {
+                        "message": "failedToResolveRemoteUser.",
+                        "code": "FAILED_TO_RESOLVE_REMOTE_USER",
+                        "id": "56d5e552-d55a-47e3-9f37-6dc85a93ecf9"
+                      }
+                    }
+                  },
                   "INVALID_PARAM": {
                     "value": {
                       "error": {
@@ -30115,8 +30124,7 @@
                 "type": "object",
                 "properties": {
                   "clipId": {
-                    "type": "string",
-                    "format": "misskey:id"
+                    "type": "string"
                   }
                 },
                 "required": [
@@ -30273,6 +30281,26 @@
             "bearerAuth": []
           }
         ],
+        "requestBody": {
+          "required": true,
+          "content": {
+            "application/json": {
+              "schema": {
+                "type": "object",
+                "properties": {
+                  "withLocal": {
+                    "type": "boolean",
+                    "default": true
+                  },
+                  "withRemote": {
+                    "type": "boolean",
+                    "default": true
+                  }
+                }
+              }
+            }
+          }
+        },
         "responses": {
           "200": {
             "description": "OK (with results)",

Get diff files from Workflow Page

@kozakura913
Copy link
Collaborator Author

リモートお気に入り登録してもお気に入り登録数には反映されない仕様。リモートは読み取りしかできないし、単にローカルの加算するだけでは他インスタンスからリモートお気に入り登録した値が反映されないし、開き直ってリモート側の値そのまま使う事にした

@kozakura913 kozakura913 merged commit 4838494 into yojo-art:develop Sep 14, 2024
27 of 28 checks passed
@kozakura913 kozakura913 deleted the issue_296 branch September 14, 2024 05:25
@kozakura913 kozakura913 added this to the yojo1.1.0 milestone Sep 14, 2024
@kozakura913 kozakura913 mentioned this pull request Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

リモートクリップのお気に入り登録
2 participants