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

Feat: searchableByの対応 #519

Merged
merged 48 commits into from
Nov 4, 2024
Merged

Conversation

penginn-net
Copy link
Collaborator

@penginn-net penginn-net commented Oct 20, 2024

What

searchableByの対応

Why

Resolve #440

Additional info (optional)

searchable_by_nobodyにも対応

  • バック(AP)
  • バック(投稿)
  • インデックス除外
  • バック(検索)
  • フロント(投稿)
  • ユーザー設定

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 Oct 20, 2024

Codecov Report

Attention: Patch coverage is 14.34426% with 627 lines in your changes missing coverage. Please review.

Project coverage is 40.45%. Comparing base (d6e2071) to head (1bba10a).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
packages/backend/src/core/QueryService.ts 1.19% 165 Missing ⚠️
...s/frontend/src/components/CPSearchbilityPicker.vue 0.00% 161 Missing and 1 partial ⚠️
packages/backend/src/core/AdvancedSearchService.ts 3.87% 149 Missing ⚠️
packages/frontend/src/pages/settings/privacy.vue 0.00% 37 Missing ⚠️
...kages/frontend/src/components/MkPostFormSimple.vue 0.00% 27 Missing ⚠️
...ntend/src/components/MkUserSetupDialog.Privacy.vue 0.00% 20 Missing ⚠️
.../backend/src/core/activitypub/ApRendererService.ts 6.66% 14 Missing ⚠️
packages/backend/src/core/ReactionService.ts 0.00% 13 Missing ⚠️
.../backend/src/core/activitypub/ApAudienceService.ts 29.41% 12 Missing ⚠️
packages/frontend/src/store.ts 0.00% 12 Missing ⚠️
... and 9 more
Additional details and impacted files
@@             Coverage Diff              @@
##           develop     #519       +/-   ##
============================================
- Coverage    60.02%   40.45%   -19.57%     
============================================
  Files          882     1676      +794     
  Lines       102419   227331   +124912     
  Branches      2697     2730       +33     
============================================
+ Hits         61472    91967    +30495     
- Misses       40890   134753    +93863     
- Partials        57      611      +554     

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

Copy link
Contributor

github-actions bot commented Oct 20, 2024

이 PR에 의한 api.json 차이

차이점은 여기에서 볼 수 있음
--- base
+++ head
@@ -50055,6 +50055,15 @@
                   "isIndexable": {
                     "type": "boolean"
                   },
+                  "searchableBy": {
+                    "type": "string",
+                    "enum": [
+                      "public",
+                      "followersAndReacted",
+                      "reactedOnly",
+                      "private"
+                    ]
+                  },
                   "hideOnlineStatus": {
                     "type": "boolean"
                   },
@@ -57297,6 +57306,19 @@
                     ],
                     "default": null
                   },
+                  "searchableBy": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "enum": [
+                      "public",
+                      "followersAndReacted",
+                      "reactedOnly",
+                      "private"
+                    ],
+                    "default": "public"
+                  },
                   "disableRightClick": {
                     "type": "boolean",
                     "default": false
@@ -57798,6 +57820,19 @@
                     ],
                     "default": null
                   },
+                  "searchableBy": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "enum": [
+                      "public",
+                      "followersAndReacted",
+                      "reactedOnly",
+                      "private"
+                    ],
+                    "default": "public"
+                  },
                   "disableRightClick": {
                     "type": "boolean",
                     "default": false

Get diff files from Workflow Page

@penginn-net penginn-net added this to the yojo1.1.0 milestone Oct 20, 2024
@penginn-net
Copy link
Collaborator Author

🏳

@penginn-net
Copy link
Collaborator Author

デフォ値がpublicだからindexableは落ちるに決まってましたわ

@penginn-net penginn-net self-assigned this Nov 1, 2024
@penginn-net penginn-net marked this pull request as ready for review November 1, 2024 17:32
@@ -954,6 +986,9 @@ export class AdvancedSearchService {
minimum_should_match: 1,
},
});
osFilter.bool.must_not.push({ term: { searchableBy: 'followersAndReacted' } });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

publicを許可にした方が良さそう

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

publicを許可にすると対応前に作成された投稿すべてが出てこなくなるのはどうなのという気持ち

@@ -188,22 +188,26 @@ export class QueryService {
}

@bindThis
public generateVisibilityQuery(q: SelectQueryBuilder<any>, me?: { id: MiUser['id'] } | null, followingFilter?: string): void {
public generateVisibilityQuery(q: SelectQueryBuilder<any>, me?: { id: MiUser['id'] } | null, search?: boolean, followingFilter?: string): void {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この位置にオプション追加すると意図しない影響出そう

packages/backend/src/core/activitypub/ApAudienceService.ts Outdated Show resolved Hide resolved
packages/backend/src/core/activitypub/ApInboxService.ts Outdated Show resolved Hide resolved
packages/backend/src/server/ActivityPubServerService.ts Outdated Show resolved Hide resolved
});

//色々出てくる
test('searchableBy(user: null, indexable false)', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一応publicでリアクションするケースもカバーしときたい

@penginn-net penginn-net merged commit d1ad89e into yojo-art:develop Nov 4, 2024
29 of 30 checks passed
@penginn-net penginn-net deleted the searchable-by branch November 4, 2024 08:32
@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.

SearchableByへの対応
2 participants