fix(chart): PerUserDriveChart.update で userId が null のシステム所有ファイルをスキップ (#17499)

fix(chart): PerUserDriveChart.update で userId が null のシステム所有ファイルをスキップ (#17498)

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
SASAPIYO (SASAGAWA Kiyoshi) 2026-06-04 10:28:26 +09:00 committed by GitHub
commit 3246dad53e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View file

@ -18,6 +18,7 @@
### Server
- Enhance: リモートノートクリーニングジョブのスキップ処理のパフォーマンス改善
- Fix: PerUserDriveChart がシステム所有ファイル (userId が null) の更新で `"group"` の非NULL制約違反によりクラッシュする問題を修正 (#17498)
- Enhance: リモートノートクリーニングジョブの削除対象検索処理のパフォーマンス改善
- Fix: センシティブメディア自動検出周りの依存関係・ファイルの解決に失敗する問題を修正
- Fix: フォロワー限定投稿を指名投稿で引用した際に、引用した投稿の公開範囲が意図せず変更される問題を修正

View file

@ -56,6 +56,10 @@ export default class PerUserDriveChart extends Chart<typeof schema> { // eslint-
@bindThis
public async update(file: MiDriveFile, isAdditional: boolean): Promise<void> {
// MiDriveFile.userId is nullable (system-owned files such as the instance
// icon/banner, fetched system avatars, custom emoji image uploads, etc.).
// Per-user drive accounting is not defined for ownerless files, so skip.
if (file.userId == null) return;
const fileSizeKb = file.size / 1000;
await this.commit({
'totalCount': isAdditional ? 1 : -1,