Skip to content

fix: チャンネル設定画面の権限バグ・共同管理者保存エラーを修正#15

Draft
Copilot wants to merge 2 commits intodevelopfrom
copilot/fix-channel-settings-bug
Draft

fix: チャンネル設定画面の権限バグ・共同管理者保存エラーを修正#15
Copilot wants to merge 2 commits intodevelopfrom
copilot/fix-channel-settings-bug

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 5, 2026

What

チャンネル設定画面における表示権限バグ・共同管理者リスト非表示・共同管理者保存時のJSONエラーを修正。

Frontend (channel-editor.vue)

  • isOwnerisRoot(オーナーorモデレーター)と分離し、譲渡ボタンをオーナーのみに制限 (v-if="isOwner")
  • save() が常に collaboratorIds: [] を送信していた問題を修正 — 権限のないユーザー(共同管理者)が保存するとバックエンドで ACCESS_DENIED になっていた。isRoot のときのみ送信するよう変更
  • 共同管理者リスト用のCSSモジュールクラス (userItem, userItemMain, userItemMainBody, unassign) が未定義だったため追加

Backend (channels/update.ts)

  • channelService.setCollaborators() を別途呼んでいたのを廃止し、collaboratorIds の更新を channelsRepository.update() のメイン呼び出しに統合 — pinnedNoteIds と同じパスを通ることで TypeORM のシリアライズ問題 (invalid input syntax for type json) を解消
  • collaboratorIds: [] 時に In([]) を呼ばないよう空配列ガードを追加

Entity (Channel.ts)

  • collaboratorIds カラム定義をマイグレーション実体 (character varying(64)[]) に合わせ、...id() スプレッド (length: 32) から @Column('varchar', { array: true, length: 64 }) に修正 (pinnedNoteIds と同形式)

Why

  • 共同管理者がチャンネル設定を開くと譲渡ボタンが見えていた(isRoot はモデレーターも含むが、譲渡はオーナー専用操作)
  • 共同管理者がSaveすると collaboratorIds: [] が常に送られ ACCESS_DENIED になっていた
  • オーナーが共同管理者を追加しようとすると invalid input syntax for type json が発生し保存できなかった(TypeORM の update() が配列カラムを誤ってシリアライズする問題で、メインの update call に統合することで回避)

Additional info (optional)

ChannelService.setCollaborators() / addCollaborator() / removeCollaborator() メソッド自体は他から呼ばれていないが、そのまま残置。直接 channelsRepository.update() を呼んでいるコードが今後生じる場合は同様の問題に注意。

Checklist

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

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • download.cypress.io
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node dist/index.js --exec install (dns block)
  • https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.9.1.tar.gz
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node scripts/install.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 5, 2026 that may be closed by this pull request
- Frontend: Add isOwner variable; show transfer button only to channel owner
  (not all root/moderator users)
- Frontend: Fix save() to not send collaboratorIds when user lacks permission
  (co-admins always sent empty collaboratorIds causing access denied errors)
- Frontend: Add missing CSS styles for collaborator user list items
- Backend: Move collaboratorIds update into main channelsRepository.update()
  call to fix JSON serialization error (was in separate setCollaborators call)
- Backend: Handle empty collaboratorIds array correctly (skip In([]) check)
- Backend: Fix entity column definition to use explicit varchar type with
  correct length 64 matching the migration

Agent-Logs-Url: https://github.com/Type4ny-Project/Misskey/sessions/b0bc8330-a8a3-4641-bf50-6cbd2ff258fb

Co-authored-by: mattyatea <56515516+mattyatea@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix bug in channel settings display for co-admins fix: チャンネル設定画面の権限バグ・共同管理者保存エラーを修正 Apr 5, 2026
Copilot AI requested a review from mattyatea April 5, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

チャンネルの設定画面がおかしい

2 participants