Repository navigation
feat: お知らせボットを登録時に自動でフォローさせ、解除とブロックを拒む (#467 / #468) - #469
Conversation
#344 で UserListService.push の createFollowJob を止めたが、AccountMoveService に 同じ処理(リストの登録を移行先へ引き継いだ直後に、プロキシアカウントが移行先の リモートユーザーをフォローする)が残っていた。#344 と同じ形でコメントアウトする。 Fix #468 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D3TRPBgyxpbD71cJCPzJr6
コントロールパネルに「自動でフォローさせるユーザー」(meta.autoFollowUsers) を足す。 上流の misskey-dev#12451 に当たる機能をフォークで持つ。 - 新しく登録した利用者に、指定したアカウントをフォローさせる (SignupService) - ローカルの利用者が指定したアカウントへのフォローを外すことを拒む。 UserFollowingService.unfollow でまとめて止め、following/delete は 403 CANNOT_UNFOLLOW_AUTO_FOLLOW_USER を返す。一括解除・インポート・凍結時の 解除ジョブはその 1 件だけ飛ばす - 指定したアカウントのブロックも拒む (403 CANNOT_BLOCK_AUTO_FOLLOW_USER)。 ブロックするとフォローが外れ、ブロックしたのにフォローが残る矛盾も作らないため - 指定したアカウント自身がフォロワーを外す操作・利用者をブロックする操作は通す - 既存の利用者へ一括でフォローさせる管理操作 admin/auto-follow/apply を足す。 設定の保存だけでは走らせない Fix #467 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D3TRPBgyxpbD71cJCPzJr6
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0afbcd166e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await this.queueService.createFollowJob(followers.slice(i, i + 1000).map(follower => ({ | ||
| from: { id: follower.id }, | ||
| to: { id: followee.id }, | ||
| }))); |
There was a problem hiding this comment.
Reconcile existing outgoing blocks before applying follows
If an existing local user blocked the designated bot before it was added to this setting, this operation queues a follow without removing that block. UserFollowingService.follow() explicitly rejects local follows when checkBlocked(follower.id, followee.id) is true, and RelationshipProcessorService.processFollow() does not reconcile the block, so the job fails and the user remains outside the mandatory follow relationship even after repeated applications. Handle pre-existing user-to-bot blocks when applying the policy, while preserving blocks initiated by the bot.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
9082c16 で修正しました。一括適用の前に、利用者からボットへのブロックを外します。ボットからのブロックは管理者の判断なので残し、その利用者は対象から外します。e2e に両方のケースを足しています。
| } | ||
|
|
||
| // フォーク独自 (pooza/misskey#467): 指定したアカウントを自動でフォローさせる | ||
| await this.autoFollowService.followOnSignup(account); |
There was a problem hiding this comment.
Prevent follow-queue failures from aborting completed signups
When auto-follow is configured and enqueueing fails, this awaited call rejects after the account transaction has already committed. SignupApiService.signupPending() consequently exits before copying the verified email into the profile, consuming the pending registration, or signing the user in; retrying the verification link then fails because the username already exists. The non-email signup path likewise reports failure for an account that was actually created. Make follow scheduling recoverable without aborting the remaining signup finalization.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
9082c16 で修正しました。登録時のフォローのジョブ投入に失敗しても、ログに残すだけで例外は投げません(登録の後始末を止めない)。漏れた分は一括適用で拾えます。
Codex の P2 指摘 2 件への対応。 - 一括適用の前から利用者がボットをブロックしていると、フォローのジョブが 失敗し続けていた。利用者からボットへのブロックは外してからフォローさせる。 ボットからのブロックは管理者の判断なので残し、その利用者は対象から外す - 登録時のフォローのジョブ投入に失敗すると、アカウントの作成後に例外が出て メール認証の後始末やサインインが飛んでいた。失敗はログに残すだけにする Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D3TRPBgyxpbD71cJCPzJr6
What
meta.autoFollowUsers)を足す。指定したアカウント(お知らせボット)を、登録した利用者に自動でフォローさせ、ローカルの利用者からの解除とブロックを拒むFix #467
Fix #468
Why
プリセットのサーバーの規約は、お知らせボットのフォローを外すことを認めていない。Mastodon の 3 台は招待リンクの自動フォローで登録時にフォローさせられるが、Misskey には当たる機能が無い。上流の misskey-dev#12451 には頼らず、フォークで持つ(2026-11-19 の判断。解除は拒む方向で決着済み)。
Additional info (optional)
UserFollowingService.unfollowにまとめた。対象は「フォローしている側がローカルで、フォローされている側が指定したアカウント」だけ。リモートからの Undo Follow などは通るfollowing/delete: 403CANNOT_UNFOLLOW_AUTO_FOLLOW_USERblocking/create: 403CANNOT_BLOCK_AUTO_FOLLOW_USER(ブロックするとフォローが外れるため、ブロック自体を拒む)following/invalidate)・利用者をブロックする操作は通すNotPermittedErrorに合わせた)。capsicum は お知らせボットのフォローを保つ(capsicum から外させず、外れていればフォローし直す) capsicum#1402 で受けるadmin/auto-follow/apply)を一度だけ実行する。設定の保存だけでは走らない。二重にジョブが積まれないよう、1 分に 1 回までinfoは上流の既定の予約ユーザー名なので、新しいサーバーでは登録できない(ダイスキーの@infoは既存なので影響なし)検証
test/e2e/auto-follow.ts11 件 PASS(登録時の自動フォロー・解除とブロックの拒否・一括適用・ボット側の操作・設定を外したあとの解除)block.ts/move.ts/endpoints.ts160 件 PASStsc --noEmitPASS / frontendvue-tscは変更ファイルのエラー 0 件pnpm build-misskey-js-with-typesで autogen を再生成して同梱check-migrations: migration から作った DB で、meta.autoFollowUsersに関する pending DDL なし(テスト専用チャート表の index だけが出る BASELINE)node scripts/check-shipping.mjs --base origin/daisskey→ Lint / SPDX PASS。Locale safety はen-US.ymlのフォーク独自キー_autoFollowだけ(AGENTS.md 少メモリ環境への対策 #2 の例外)Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01D3TRPBgyxpbD71cJCPzJr6