Skip to content

feat(notes): add posting role policies - #122

Draft
tamaina wants to merge 13 commits into
developfrom
feat/posting-role-policies
Draft

tamaina wants to merge 13 commits into
developfrom
feat/posting-role-policies

Conversation

@tamaina

@tamaina tamaina commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

What

Administrators can control five posting permissions without suspending an account: canNote, renotePolicy, canCreateSpecifiedNote, canFederateNote, and noteFilesLimit.

Port upstream #16379 at 0858e65a5cfc0582523b316b23924ec7d0f0195a into develop. Preserve the fork's feature structure and existing SFC dictionaries.

  • Re-evaluate local users' current roles at note creation, including scheduled execution. Keep the suspended-principal rejection.
  • Add six explicit note-creation errors and preserve all five fields through /i, /meta, the central packed model, and regenerated SDK output.
  • Normalize attachment limits to finite integers in 0–16; preserve defaults when old metadata lacks the new keys.
  • Apply restrictions to the selected posting account, restored quotes, queued attachments, visibility picker, reply shortcuts and renote/file menus. Match the prohibited-word error UUID.
  • Server drafts and schedules remain owned by the signed-in account. Hide their controls while another posting account is selected, and block submitting a restored server draft as that other account.

Why

Fixes #116. This is posting control; it does not implement a complete read-only mode for reactions or other actions.

Additional info

Validated head: 5584449ca13d93fd7947b43b2924090ffb1db9c6, including develop 7c3ce9031c4b31b9e7590b3f037ae61a7f1b8c1e. Posting implementation was validated locally at 315e75fe; the final merge preserves that posting product diff and combines both strict source-proof layers.

  • Exact-head CI: 17 workflows / 43 jobs succeeded. Audited all 586 steps: zero failed steps, including the Lint matrix's individual jobs. Backend unit/E2E ran on both Node versions; federation, production build, SDK/autogen, API report, diagnostics and feature frontend/maintenance all passed. CI checks
  • Frontend full unit tests at this head: 99 suites / 1570 tests passed locally with one worker and in CI. Includes actual reactive guards, account switching, restored drafts, queued attachments, UUID mapping, all eleven exact posting rebases and all three client-error-log rebases.
  • Backend scoped local suites: 58 tests passed, including actual assign/unassign with stale assignment cache, fresh policies, attachment bounds, remote recipients/mentions, error mapping, legacy metadata defaults and /i projection. CI also passed all 34 posting-policy regressions on both Node versions and the 11 notes-create contract regressions; the maintenance selection passed 712 tests with 2 skipped.
  • Local implementation checks passed: backend source/test/federation types, frontend full vue-tsc, backend/frontend production builds, SDK build/OpenAPI generation/API Extractor. Final integration also passed shipping lint/SPDX/locale safety and the 349-module portable-contract check; builds/types/DB/browser were not repeated locally just for the two proof-test merge conflicts.
  • Independent exact-head review passed with no required fixes. Both restore functions and all original assertions survive the two test conflicts; eleven posting and three client-error-log source sets are disjoint. Existing SFC dictionaries and the 196 locale blocks in the posting scope are preserved.
  • Own workspace outputs and external-package links only; no dependency install. Six shared metadata/bin fingerprints remained unchanged. Native backend checks used GOMAXPROCS=1 for resource coordination; no default-heap OOM occurred in this task. Initial own-checkout build prerequisites (misskey-reversi output and frontend-shared idb-keyval link) were prepared before successful validation.

Live browser screenshots, DB/queue integration, and full read-only behavior are not claimed. Local UI validation uses small synthetic reactive fixtures. Fresh local policy evaluation adds role/assignment reads per post; large-instance performance is unmeasured. Keep this as a Draft; no merge, deployment or upstream posting is requested.

CHANGELOG candidate: 投稿ロールでノート・引用・指名・連合・添付数を制限できるようにする。

Checklist

  • Read the contribution guide
  • Add focused regression tests and validate locally
  • Live browser/UI screenshot and DB/queue integration
  • Update CHANGELOG (left unchanged under repository instructions)

tamaina and others added 2 commits October 13, 2026 19:17
Port upstream misskey-dev/misskey#16379 at 0858e65a5cfc0582523b316b23924ec7d0f0195a.
Preserve strict API/SDK projections and existing feature locale dictionaries.
Re-evaluate local posting policies at creation time and restrict server drafts
and schedules to their signed-in owner when switching posting accounts.

Refs: #116
Co-authored-by: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

⚙️ Backend Diagnostics Report

Memory: After GC

(No significant changes)

V8 Heap Snapshot Statistics

Metric @ Base @ Head Δ MAD
$\color{gray}{\rule{8pt}{8pt}}$ Total 87 MB
± 5.5 KB
87 MB
± 1.4 KB
$\text{+31 KB}$
$\text{+0\%}$
5.7 KB
$\color{orange}{\rule{8pt}{8pt}}$ Code 24 MB 24 MB $\text{+4.6 KB}$ 3.8 KB
$\color{red}{\rule{8pt}{8pt}}$ Strings 25 MB 25 MB $\text{+3.8 KB}$ 158 B
$\color{cyan}{\rule{8pt}{8pt}}$ JS arrays 6.4 MB 6.4 MB $\text{-768 B}$ 0 B
$\color{green}{\rule{8pt}{8pt}}$ Typed arrays 723 KB 723 KB 0 B 0 B
$\color{yellow}{\rule{8pt}{8pt}}$ System objects 3 MB 3 MB $\text{+1.6 KB}$ 495 B
$\color{violet}{\rule{8pt}{8pt}}$ Other JS objs 28 MB 28 MB $\text{+15 KB}$ 448 B
$\color{pink}{\rule{8pt}{8pt}}$ Other non-JS objs 65 KB 65 KB $\text{+128 B}$ 0 B

Download representative heap snapshot: base / head

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🖥 Frontend Diagnostics Report

Metric @ Base @ Head Δ MAD
Encoded network 4.1 MB
± 586 B
4.1 MB
± 12 B
$\color{orange}{\text{+16 KB}}$
$\color{orange}{\text{+0.4\%}}$
586 B
Decoded body 3.8 MB
± 0 B
3.8 MB
± 0 B
$\color{orange}{\text{+16 KB}}$
$\color{orange}{\text{+0.4\%}}$
0 B
Same-origin encoded 3.9 MB
± 0 B
3.9 MB
± 0 B
$\color{orange}{\text{+16 KB}}$
$\color{orange}{\text{+0.4\%}}$
0 B
Script encoded 3.3 MB
± 0 B
3.3 MB
± 0 B
$\color{orange}{\text{+15 KB}}$
$\color{orange}{\text{+0.5\%}}$
0 B

Only metrics showing significant changes are displayed.

View details

Requests by resource type
Type Requests Encoded bytes
Base Head Δ Base Head Δ
Document 2 2 0 37 KB 37 KB $\color{orange}{\text{+222 B}}$
Script 179 179 0 3.3 MB 3.3 MB $\color{orange}{\text{+15 KB}}$
Stylesheet 62 62 0 282 KB 282 KB 0 B
Fetch 23 23 0 76 KB 77 KB $\color{orange}{\text{+555 B}}$
Image 11 11 0 70 KB 70 KB $\color{orange}{\text{+111 B}}$
Font 2 2 0 119 KB 119 KB 0 B
Other 9 9 0 173 KB 173 KB $\color{orange}{\text{+15 B}}$
V8 heap snapshot statistics
Metric @ Base @ Head Δ MAD
$\color{gray}{\rule{8pt}{8pt}}$ Total 14 MB
± 2.5 KB
14 MB
± 4.6 KB
$\text{+27 KB}$
$\text{+0.2\%}$
5.2 KB
$\color{orange}{\rule{8pt}{8pt}}$ Code 3.3 MB 3.3 MB $\text{+8.5 KB}$ 2.2 KB
$\color{red}{\rule{8pt}{8pt}}$ Strings 1.6 MB 1.6 MB $\text{+3.7 KB}$ 99 B
$\color{cyan}{\rule{8pt}{8pt}}$ JS arrays 130 KB 130 KB $\text{+72 B}$ 108 B
$\color{green}{\rule{8pt}{8pt}}$ Typed arrays 0 B 0 B 0 B 0 B
$\color{yellow}{\rule{8pt}{8pt}}$ System objects 0 B 0 B 0 B 0 B
$\color{violet}{\rule{8pt}{8pt}}$ Other JS objs 2.7 MB 2.7 MB $\text{+4.6 KB}$ 490 B
$\color{pink}{\rule{8pt}{8pt}}$ Other non-JS objs 6.1 MB 6.1 MB $\text{+11 KB}$ 5 KB

Download representative heap snapshot: base / head

📦 Bundle Stats

Chunk size diff (53 updated, 0 added, 0 removed)
Chunk Base Head Δ Δ (%)
(total) 17 MB 17 MB $\color{orange}{\text{+167 KB}}$ $\color{orange}{\text{+1\%}}$
virtual:vite-vue-internationalization/locale/th-TH scripts/hvhWu9yWI-6BUDGO2j.js → scripts/hvhWu9yWI-DuNakMF0.js
416 KB 419 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+0.9\%}}$
virtual:vite-vue-internationalization/locale/ru-RU scripts/hvhWu9yWI-De2wrp_j.js → scripts/hvhWu9yWI-BfFUa__4.js
309 KB 313 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/uk-UA scripts/hvhWu9yWI-CBYVEasZ.js → scripts/hvhWu9yWI-Cp6N1Iq1.js
303 KB 306 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/bn-BD scripts/hvhWu9yWI-DNymQIjt.js → scripts/hvhWu9yWI-OLr8y2lE.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/lo-LA scripts/hvhWu9yWI-DM-W39QP.js → scripts/hvhWu9yWI-CMzjU_vj.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/si-LK scripts/hvhWu9yWI-BCklwFpA.js → scripts/hvhWu9yWI-CNWIFPgh.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/el-GR scripts/hvhWu9yWI-1rfwoNGS.js → scripts/hvhWu9yWI-Bd3PUuD0.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/fa-IR scripts/hvhWu9yWI-BuCLsn8O.js → scripts/hvhWu9yWI-B5uBBbNU.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/jbo-EN scripts/hvhWu9yWI-B6ey4ku4.js → scripts/hvhWu9yWI-AcWIMIUf.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/ja-JP scripts/hvhWu9yWI-CpUax1nh.js → scripts/hvhWu9yWI-D6I4Jen4.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/ro-RO scripts/hvhWu9yWI-cHjlvOEx.js → scripts/hvhWu9yWI-DAscIebL.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/tl-PH scripts/hvhWu9yWI-WmFh-QtI.js → scripts/hvhWu9yWI-DEMbvR7f.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/ko-GS scripts/hvhWu9yWI-CIQmXLQs.js → scripts/hvhWu9yWI-CtWK23vo.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/hu-HU scripts/hvhWu9yWI-D0NOThS3.js → scripts/hvhWu9yWI-BFkOfaxu.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/uz-UZ scripts/hvhWu9yWI-IhM6IV_a.js → scripts/hvhWu9yWI-DgsPejH2.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/sv-SE scripts/hvhWu9yWI-_wg6hYhw.js → scripts/hvhWu9yWI-CzD_BVp4.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/hr-HR scripts/hvhWu9yWI-FzpAY-OZ.js → scripts/hvhWu9yWI-Bq-ONVxI.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/ht-HT scripts/hvhWu9yWI-BtOFlaHL.js → scripts/hvhWu9yWI-B24RF4SK.js
275 KB 279 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/ja-KS scripts/hvhWu9yWI-ZNUP_OHJ.js → scripts/hvhWu9yWI-Bdx5evkd.js
273 KB 277 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/de-DE scripts/hvhWu9yWI-BNkDhIaF.js → scripts/hvhWu9yWI-Dka1f8cz.js
256 KB 260 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.4\%}}$
virtual:vite-vue-internationalization/locale/ko-KR scripts/hvhWu9yWI-C74MFsQK.js → scripts/hvhWu9yWI-EN7yUy2Z.js
255 KB 259 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.4\%}}$
virtual:vite-vue-internationalization/locale/ar-SA scripts/hvhWu9yWI-KMowWDhb.js → scripts/hvhWu9yWI-C2sTfIN7.js
253 KB 257 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.4\%}}$
virtual:vite-vue-internationalization/locale/ca-ES scripts/hvhWu9yWI-4D-oVee6.js → scripts/hvhWu9yWI-BnGamme7.js
253 KB 256 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.4\%}}$
virtual:vite-vue-internationalization/locale/vi-VN scripts/hvhWu9yWI-DBUdLXRb.js → scripts/hvhWu9yWI-rtnBRVAa.js
252 KB 256 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.4\%}}$
virtual:vite-vue-internationalization/locale/es-ES scripts/hvhWu9yWI-D3EJmvcB.js → scripts/hvhWu9yWI-CKQjN7ZR.js
251 KB 255 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.5\%}}$
virtual:vite-vue-internationalization/locale/fr-FR scripts/hvhWu9yWI-BESGr_Oo.js → scripts/hvhWu9yWI-DF4FEGoP.js
250 KB 254 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.5\%}}$
virtual:vite-vue-internationalization/locale/tr-TR scripts/hvhWu9yWI-CvwmuTDC.js → scripts/hvhWu9yWI-Cz4zk1yN.js
250 KB 254 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.5\%}}$
virtual:vite-vue-internationalization/locale/it-IT scripts/hvhWu9yWI-DfrzBRAx.js → scripts/hvhWu9yWI-9hSZlzaJ.js
248 KB 252 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.5\%}}$
virtual:vite-vue-internationalization/locale/pt-PT scripts/hvhWu9yWI-B06ksqfl.js → scripts/hvhWu9yWI-B5WVFAwz.js
247 KB 250 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.5\%}}$
virtual:vite-vue-internationalization/locale/cs-CZ scripts/hvhWu9yWI-6P8kiDNq.js → scripts/hvhWu9yWI-BJ_lSnK8.js
240 KB 244 KB $\color{orange}{\text{+3.6 KB}}$ $\color{orange}{\text{+1.5\%}}$
(other generated chunks) 2.5 MB 2.5 MB $\color{orange}{\text{+12 KB}}$ $\color{orange}{\text{+0.5\%}}$
(other) 3.2 MB 3.2 MB $\color{orange}{\text{+45 KB}}$ $\color{orange}{\text{+1.4\%}}$
Startup chunk size (0 updated, 0 added, 0 removed)
Chunk Base Head Δ Δ (%)
(total) 130 KB 130 KB 0 B 0%
(other generated chunks) 124 KB 124 KB 0 B 0%
(other) 5.3 KB 5.3 KB 0 B 0%

Startup chunks are the Vite entry for src/_boot_.ts and its static imports.

Bundles Modules Entries Imports Size
Static Dynamic Rendered Gzip Brotli
Base 538 3,186 24 10,857 389 24 MB 6.2 MB 5 MB
Head 538 3,272 24 10,950 389 24 MB 6.3 MB 5 MB
Δ 0 $\color{orange}{\text{+86}}$ 0 $\color{orange}{\text{+93}}$ 0 $\color{orange}{\text{+226 KB}}$ $\color{orange}{\text{+71 KB}}$ $\color{orange}{\text{+50 KB}}$
Δ (%) 0% $\color{orange}{\text{+2.7\%}}$ 0% $\color{orange}{\text{+0.9\%}}$ 0% $\color{orange}{\text{+1\%}}$ $\color{orange}{\text{+1.1\%}}$ $\color{orange}{\text{+1\%}}$

Open treemap HTML

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

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

1420 追加行 / 43 削除行 (57072 bytes)

大きい差分のため、先頭8 KiBのみ表示します。全文とbase/head JSONはartifactに保存しています。

差分の先頭(省略あり)
--- base
+++ head
@@ -14930,6 +14930,28 @@
           },
           "watermarkAvailable": {
             "type": "boolean"
+          },
+          "canNote": {
+            "type": "boolean"
+          },
+          "renotePolicy": {
+            "enum": [
+              "allow",
+              "renoteOnly",
+              "disallow"
+            ],
+            "type": "string"
+          },
+          "canCreateSpecifiedNote": {
+            "type": "boolean"
+          },
+          "canFederateNote": {
+            "type": "boolean"
+          },
+          "noteFilesLimit": {
+            "type": "integer",
+            "minimum": 0,
+            "maximum": 16
           }
         },
         "required": [
@@ -14971,7 +14993,12 @@
           "chatAvailability",
           "noteDraftLimit",
           "scheduledNoteLimit",
-          "watermarkAvailable"
+          "watermarkAvailable",
+          "canNote",
+          "renotePolicy",
+          "canCreateSpecifiedNote",
+          "canFederateNote",
+          "noteFilesLimit"
         ],
         "additionalProperties": false,
         "$schema": "https://json-schema.org/draft/2020-12/schema"
@@ -19069,6 +19096,28 @@
           },
           "watermarkAvailable": {
             "type": "boolean"
+          },
+          "canNote": {
+            "type": "boolean"
+          },
+          "renotePolicy": {
+            "enum": [
+              "allow",
+              "renoteOnly",
+              "disallow"
+            ],
+            "type": "string"
+          },
+          "canCreateSpecifiedNote": {
+            "type": "boolean"
+          },
+          "canFederateNote": {
+            "type": "boolean"
+          },
+          "noteFilesLimit": {
+            "type": "integer",
+            "minimum": 0,
+            "maximum": 16
           }
         },
         "required": [
@@ -19110,7 +19159,12 @@
           "chatAvailability",
           "noteDraftLimit",
           "scheduledNoteLimit",
-          "watermarkAvailable"
+          "watermarkAvailable",
+          "canNote",
+          "renotePolicy",
+          "canCreateSpecifiedNote",
+          "canFederateNote",
+          "noteFilesLimit"
         ],
         "additionalProperties": false
       },
@@ -21567,6 +21621,28 @@
           },
           "watermarkAvailable": {
             "type": "boolean"
+          },
+          "canNote": {
+            "type": "boolean"
+          },
+          "renotePolicy": {
+            "enum": [
+              "allow",
+              "renoteOnly",
+              "disallow"
+            ],
+            "type": "string"
+          },
+          "canCreateSpecifiedNote": {
+            "type": "boolean"
+          },
+          "canFederateNote": {
+            "type": "boolean"
+          },
+          "noteFilesLimit": {
+            "type": "integer",
+            "minimum": 0,
+            "maximum": 16
           }
         },
         "required": [
@@ -21608,7 +21684,12 @@
           "chatAvailability",
           "noteDraftLimit",
           "scheduledNoteLimit",
-          "watermarkAvailable"
+          "watermarkAvailable",
+          "canNote",
+          "renotePolicy",
+          "canCreateSpecifiedNote",
+          "canFederateNote",
+          "noteFilesLimit"
         ],
         "additionalProperties": false
       },
@@ -23027,6 +23108,28 @@
           },
           "watermarkAvailable": {
             "type": "boolean"
+          },
+          "canNote": {
+            "type": "boolean"
+          },
+          "renotePolicy": {
+            "enum": [
+              "allow",
+              "renoteOnly",
+              "disallow"
+            ],
+            "type": "string"
+          },
+          "canCreateSpecifiedNote": {
+            "type": "boolean"
+          },
+          "canFederateNote": {
+            "type": "boolean"
+          },
+          "noteFilesLimit": {
+            "type": "integer",
+            "minimum": 0,
+            "maximum": 16
           }
         },
         "required": [
@@ -23068,7 +23171,12 @@
           "chatAvailability",
           "noteDraftLimit",
           "scheduledNoteLimit",
-          "watermarkAvailable"
+          "watermarkAvailable",
+          "canNote",
+          "renotePolicy",
+          "canCreateSpecifiedNote",
+          "canFederateNote",
+          "noteFilesLimit"
         ],
         "additionalProperties": false
       },
@@ -24487,6 +24595,28 @@
           },
           "watermarkAvailable": {
             "type": "boolean"
+          },
+          "canNote": {
+            "type": "boolean"
+          },
+          "renotePolicy": {
+            "enum": [
+              "allow",
+              "renoteOnly",
+              "disallow"
+            ],
+            "type": "string"
+          },
+          "canCreateSpecifiedNote": {
+            "type": "boolean"
+          },
+          "canFederateNote": {
+            "type": "boolean"
+          },
+          "noteFilesLimit": {
+            "type": "integer",
+            "minimum": 0,
+            "maximum": 16
           }
         },
         "required": [
@@ -24528,7 +24658,12 @@
           "chatAvailability",
           "noteDraftLimit",
           "scheduledNoteLimit",
-          "watermarkAvailable"
+          "watermarkAvailable",
+          "canNote",
+          "renotePolicy",
+          "canCreateSpecifiedNote",
+          "canFederateNote",
+          "noteFilesLimit"
         ],
         "additionalProperties": false
       },
@@ -31425,6 +31560,28 @@
           },
           "watermarkAvailable": {
             "type": "boolean"
+          },
+          "canNote": {
+            "type": "boolean"
+          },
+          "renotePolicy": {
+            "enum": [
+              "allow",
+              "renoteOnly",
+              "disallow"
+            ],
+            "type": "string"
+          },
+          "canCreateSpecifiedNote": {
+            "type": "boolean"
+          },
+          "canFederateNote": {
+            "type": "boolean"
+          },
+          "noteFilesLimit": {
+            "type": "integer",
+            "minimum": 0,
+            "maximum": 16
           }
         },
         "required": [
@@ -31466,7 +31623,12 @@
           "chatAvailability",
           "noteDraftLimit",
           "scheduledNoteLimit",
-          "watermarkAvailable"
+          "watermarkAvailable",
+          "canNote",
+          "renotePolicy",
+          "canCreateSpecifiedNote",
+          "canFederateNote",
+          "noteFilesLimit"
         ],
         "additionalProperties": false
       },
@@ -34550,6 +34712,28 @@
           },
           "watermarkAvailable": {
             "type": "boolean"
+          },
+          "canNote": {
+            "type": "boolean"
+          },
+          "renotePolicy": {
+            "enum": [
+              "allow",
+              "renoteOnly",
+              "disallow"
+            ],
+            "type": "string"
+          },
+          "canCreateSpecifiedNote": {
+            "type": "boolean"
+          },
+          "canFederateNote": {
+            "type": "boolean"
+          },
+          "noteFilesLimit": {
+            "type": "integer",
+            "minimum": 0,
+            "maximum": 16
           }
         },
         "required": [
@@ -34591,7 +34775,12 @@
           "chatAvailability",
           "noteDraftLimit",
           "scheduledNoteLimit",
-          "watermarkAvailable"
+          "watermarkAvailable",
+          "canNote",
+          "renotePolicy",
+          "canCreateSpecifiedNote",
+          "canFederateNote",
+          "noteFilesLimit"
         ],
         "additionalProperties": false
       },
@@ -37675,6 +37864,28 @@
           },
           "watermarkAvailable": {
             "type": "boolean"
+          },
+          "canNote": {
+            "type": "boolean"
+          },
+          "renotePolicy": {
+            "enum": [
+              "allow",
+              "renoteOnly",
+              "disallow"
+            ],
+            "type": "string"
+          },
+          "canCreateSpecifiedNote": {
+            "type": "boolean"
+          },
+ 

Full diff and API JSON artifact

Workflow Page

tamaina commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

[P2] mentionLimit=0 でも、自分のノートへの返信は許可する必要があります

最新head 5584449ca13d93fd7947b43b2924090ffb1db9c6 で再確認しました。

場所: packages/features/notes/frontend/composables/use-note.ts:164。

再現条件は、投稿可能なアカウントに canNote=true、mentionLimit=0 のロールを適用し、自分の公開/ホームノートから、明示メンションを含まない返信でスレッドを続けることです。

  • 期待: 自分への返信は自動メンションを追加しないため、通常の返信操作を使える。
  • 実際: 新しい canReply が投稿者に関係なく mentionLimit > 0 を要求します。MkNote.vue/MkNoteDetailed.vue の返信ボタンが無効になり、reply() も早期returnするため操作できません。
  • 根拠: 同headの NoteCreateService.ts:632 は user.id !== data.reply.userId の場合だけ返信先投稿者をmentionへ追加します。実効mention数の上限判定も同ファイル657–659行にあり、明示mentionのない自己返信はこの条件に反しません。

影響は、許可された自己返信・自己スレッドを通常UIから作れなくなることです。API側の投稿権限を緩める必要はありません。修正方向は、自分のノートへの返信を canNote に沿って許可するか、一律のmention上限ショートカットを外して実効mention数をフォーム/サーバーで判定することです。canNote=true, mentionLimit=0 の「自分/別の投稿者」の両方を回帰テストで確認するとよいです。

検証: このheadの実際の canReply 式を抽出して実行し、自己返信でもfalseになることを再現しました。サーバーの受理条件は実装の静的追跡です。実ブラウザー・実DB/APIの結合再現、ロール変更からのE2Eは今回実行していません。既存テストはselected account、quote、file、federation、draft/scheduleを確認していますが、この自己返信条件はカバーしていません。

# Conflicts:
#	packages/frontend/test/unit/drive-ownership-rebase.test.ts
#	packages/frontend/test/unit/final-screen-locale-migration.test.ts
#	packages/frontend/test/unit/sfc-locale-migration.test.ts
#	packages/frontend/test/unit/sfc-next74-locale-migration.test.ts
…policies

# Conflicts:
#	packages/backend/src/server/api/note-create-contracts.test.ts
#	packages/features/auth/test/backend/2fa-api-aliases.test.ts
#	packages/features/drive/frontend/utility/get-drive-file-menu.ts
#	packages/features/instance/test/backend/finite-contracts.test.ts
#	packages/features/notes/frontend/components/MkPostForm.vue
#	packages/features/notes/frontend/utility/get-note-menu.ts
#	packages/features/roles/frontend/pages/admin/roles.policy-editor.vue
#	packages/frontend/test/unit/drive-ownership-rebase.test.ts
#	packages/frontend/test/unit/final-screen-locale-migration.test.ts
#	packages/frontend/test/unit/final-ts-locale-migration.test.ts
#	packages/frontend/test/unit/formatter-next10-migration.test.ts
#	packages/frontend/test/unit/formatter-next20-migration.test.ts
#	packages/frontend/test/unit/formatter-remaining20-migration.test.ts
#	packages/frontend/test/unit/password-change-source-rebase.test.ts
#	packages/frontend/test/unit/pwa-share-source-rebase.test.ts
#	packages/frontend/test/unit/sfc-locale-migration.test.ts
#	packages/frontend/test/unit/sfc-next74-locale-migration.test.ts
#	packages/frontend/test/unit/upstream-common-utilities-source-rebase.test.ts
#	packages/frontend/test/unit/upstream-crowdin-values.test.ts
#	packages/frontend/test/unit/upstream-develop-source-rebase.test.ts
#	packages/frontend/test/unit/upstream-develop-source-rebase.ts
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.

feat: port posting role policies from upstream #16379

1 participant