Skip to content

デフォルトハッシュタグ - #13098

Closed
pooza wants to merge 23 commits into
misskey-dev:developfrom
pooza:feature/default-hashtag-timeline
Closed

pooza wants to merge 23 commits into
misskey-dev:developfrom
pooza:feature/default-hashtag-timeline

Conversation

@pooza

@pooza pooza commented Jan 28, 2024

Copy link
Copy Markdown

What

デフォルトハッシュタグのMisskeyむけ実装です。
この機能はダイスキーにて長期の運用実績がありますが、今回、2024.2系の為に改めて書き直しました。

例えば設定ファイルに、以下の記述を書き込むと、

defaultTag:
  tag: delmulin
  append: true

以下の機能が有効になります。

  • 公開投稿すべて、本文の末尾に #delmulin タグが加えられる。
    • /defaultTag/appendをfalseにすると、この動作を抑止できる。(拙作モロヘイヤを併用する場合など)
  • ローカルタイムラインとソーシャルタイムラインで、#delmulinタグを含む投稿が(他のサーバーの投稿であっても)ローカル投稿扱いになる。

Why

まずは経緯から。
この改造はダイスキーより早く運用されていたダイスキーの姉妹サーバーである、デルムリン丼(Mastodon)に実装されていた機能を移植したものです。
デフォルトハッシュタグはMastodonではよく知られた改造ですが、Misskeyでの先行事例を知らなかった為の独自実装となりました。

特にテーマサーバーに対して、デフォルトハッシュタグの良さを知った上で、是非採用して頂きたいと思っています。

関連Issue

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions Bot added the packages/backend Server side specific issue/PR label Jan 28, 2024
@codecov

codecov Bot commented Jan 28, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 22.66667% with 58 lines in your changes missing coverage. Please review.

Project coverage is 37.97%. Comparing base (22c4e9d) to head (f4fb82b).
Report is 756 commits behind head on develop.

Files with missing lines Patch % Lines
packages/backend/src/core/NoteCreateService.ts 0.00% 22 Missing ⚠️
...d/src/server/api/endpoints/notes/local-timeline.ts 15.38% 11 Missing ⚠️
.../src/server/api/stream/channels/hybrid-timeline.ts 18.18% 9 Missing ⚠️
...d/src/server/api/stream/channels/local-timeline.ts 18.18% 9 Missing ⚠️
.../src/server/api/endpoints/notes/hybrid-timeline.ts 22.22% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #13098      +/-   ##
===========================================
- Coverage    40.07%   37.97%   -2.11%     
===========================================
  Files         1524     1524              
  Lines       188792   188863      +71     
  Branches      3515     2540     -975     
===========================================
- Hits         75666    71715    -3951     
- Misses      112552   116570    +4018     
- Partials       574      578       +4     

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

@github-actions

github-actions Bot commented Jan 28, 2024 •

Copy link
Copy Markdown
Contributor

このPRによるapi.jsonの差分

差分はこちら

Get diff files from Workflow Page

@kakkokari-gtyih kakkokari-gtyih linked an issue Jan 28, 2024 that may be closed by this pull request
1 task done

@samunohito samunohito left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

issue側がどのような展開を迎えるか未知数ですが、コードを見ていて気になったところがありましたのでコメントします。

if (defaultTag == null) {
qb.andWhere('note.userHost IS NULL');
} else {
qb.andWhere(`':t' = any(note.tags)`, { t: normalizeForSearch(defaultTag) });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

anyだとフルスキャンになったりしませんでしょうか…?
以下に記載するissueについてもご確認いただけますと幸いです。

参考:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@samunohito
自分では気付くことができなかったところです。とても参考になりました。
次回の修正に含めさせて頂きます。

@samunohito

Copy link
Copy Markdown
Member

あと、「デフォルトハッシュタグ」とはなんぞや…?という説明書きが何処かにあると管理者にやさしいかと思います。
他SNSで概念を知っているか、issueを見た人でなければどのようなものか分からないかと思われます

@kakkokari-gtyih

kakkokari-gtyih commented Jan 28, 2024 •

Copy link
Copy Markdown
Member

#13097 (comment) ←技術的な懸念点の指摘をさせていただきました🙏

@pooza

pooza commented Jan 29, 2024

Copy link
Copy Markdown
Author

各位、様々なご指摘ご指導、まことにありがとうございました。
本業の暇を見つつ順次対応していきます。気長にお待ち頂ければと思います。

@pooza pooza closed this Mar 3, 2025
@pooza
pooza deleted the feature/default-hashtag-timeline branch March 3, 2025 22:16
@github-project-automation github-project-automation Bot moved this from Todo to Done in [実験中] 管理用 Mar 3, 2025
@pooza
pooza restored the feature/default-hashtag-timeline branch March 3, 2025 22:16
@pooza
pooza deleted the feature/default-hashtag-timeline branch September 3, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages/backend Server side specific issue/PR

Projects

Development

Successfully merging this pull request may close these issues.

デフォルトハッシュタグ

3 participants