Skip to content

MisskeyChatStreaming._onMessage の catch でスキーマ変更を検知できない #448

Closed

Description

@pooza

問題

chat_streaming.dart:103 の `onMessage` で復号後の JSON parse / 型変換失敗を `catch () {}` で完全沈黙している。

サーバー側 schema 変更(fediverse_objects 側のパースで起きる型エラー含む)に気付けず、ユーザーには「ストリーミング来ない」だけが見える。Sentry にも上がらない。

推奨対応

  • `Sentry.addBreadcrumb` でメッセージ先頭 100 文字程度(PII 除く)を記録
  • 連続失敗時は `Sentry.captureException` でレート制限付き送信
  • 最低限 `debugPrint` で開発時のみ可視化

経緯

v1.22.0 リリース前 5 観点レビュー(エラー処理・観測性)で検出。黄判定で v1.23 送り。

Activity

  1. added this to the v1.23 milestone on May 1, 2026
  2. added
    enhancement
    on May 1, 2026
  3. modified the milestones: v1.23, v1.25 on May 2, 2026
  4. added a commit that references this issue on May 11, 2026
    c8aa621
  5. pooza commented on May 11, 2026

    @pooza
    OwnerAuthor

    v1.25 develop (c8aa621) で対応。`ChatSupport.streamChatMessages` に optional `onParseError` callback を追加し、capsicum_backends 内の `MisskeyChatStreaming` から catch 時に呼び出す形に変更。capsicum 本体側 (chat_provider) で:

    • 毎回 `Sentry.addBreadcrumb` (category: chat.stream.parse、warning レベル、err.toString() を 200 字で打ち切り)
    • 60 秒スロットルで `Sentry.captureException` (tag chat.stream.parse=failed、fingerprint で runtimeType ごとにグループ)

    の二段構えで観測する。layer 跨ぎ (backends → 本体) はコールバック注入で分離し、capsicum_backends は sentry に依存しない。

    観測経路追加のみで挙動変化なし、close。

  6. added a commit that references this issue on May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions