Repository navigation
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters: 1
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including
|
| Layer / File(s) | Summary |
|---|---|
undefinedプロパティの除外 packages/backend/src/misc/clone.ts, packages/frontend/src/utility/clone.ts |
両方のdeepCloneで、undefinedのプロパティを複製先に追加しないよう変更しました。その他の値は引き続き再帰的に複製します。 |
Priority:
Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Bug fix
Suggested reviewers: syuilo
Merge Risk: 
Minimal · previous review 6b0c4
-
This targeted change addresses the reported posting failure without an identified merge-blocking risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
複製の枝に、ひとつの変化
undefinedはそっと通り過ぎ
定義された値は、再帰の道へ
バックエンドにも、フロントエンドにも
同じふるまいが並びます
Comment @coderabbitai help to get the list of available commands.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #18070 +/- ##
============================================
+ Coverage 12.85% 26.74% +13.89%
============================================
Files 225 1162 +937
Lines 11096 39871 +28775
Branches 3682 10982 +7300
============================================
+ Hits 1426 10665 +9239
- Misses 7595 23432 +15837
- Partials 2075 5774 +3699 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
このPRによるapi.jsonの差分 |
⚙️ Backend Diagnostics ReportMemory: After GC(No significant changes) V8 Heap Snapshot Statistics
|
🖥 Frontend Diagnostics Report(No significant changes) Requests by resource type
V8 heap snapshot statistics
📦 Bundle StatsChunk size diff (0 updated, 0 added, 0 removed)
Startup chunk size (0 updated, 0 added, 0 removed)
Startup chunks are the Vite entry for
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
ありがとうございます。応急処置としては良さそうですが、そもそもAiScriptがundefinedをnullに変換することが正しいのか疑問があるので、根本的にはそれが直った方が良さそうですね |
私も同じ見解でいます。 |
What
deepClone(frontend:packages/frontend/src/utility/clone.ts、backend:packages/backend/src/misc/clone.ts)で、値がundefinedのプロパティをキーごと複製しないようにしました。これにより、
Plugin:register_note_post_interruptorを使ったプラグインを有効にしてもノートを投稿できるようになります。Why
Plugin:register_note_post_interruptorを使ったプラグインを有効にすると、プラグインがnoteを加工せずに返す場合でも、投稿時にInvalid param.(3d81ceae-475f-4600-b2a8-2bc116157532)になります。発見の経緯と調査内容は jj1guj#214 にまとめています。
原因は次のとおりです。
MkPostFormのpostDataは、使わない項目(fileIds、visibleUserIdsなど)を値がundefinedのキーとして持っている。deepCloneはこのキーを残したまま複製し、プラグインに渡すjsToValはObject.entriesでキーを列挙し、undefinedをNULLに変換するvalToJsで JS の値に戻すとfileIds: nullなどが残り、そのままnotes/createに送られる。fileIdsとvisibleUserIdsは nullable ではないため、パラメータ検証に失敗するこの問題は #9207 で報告されており、#12926 で
deepCloneの修正(if (v !== undefined) obj[k] = deepClone(v);)が入りました。しかしレビュー中のコミット 57324bf でobj[k] = v === undefined ? undefined : deepClone(v);に変更されています。deepClone(undefined)はundefinedを返すため、変更後の処理は修正前と実質的に同じで、問題が再発していました。この PR では、#12926 で最初に入った修正と同じ形に戻します。
Additional info (optional)
deepCloneで値がundefinedのプロパティは複製後にキーごと存在しなくなります。Checklist