Skip to content

feat(sender): ?debug=true で送信パイプラインの詳細ログを出力 - #78

Merged
kuu13580 merged 1 commit into
mainfrom
feature/upload-debug-logger
Jun 15, 2026
Merged

feat(sender): ?debug=true で送信パイプラインの詳細ログを出力#78
kuu13580 merged 1 commit into
mainfrom
feature/upload-debug-logger

Conversation

@kuu13580

Copy link
Copy Markdown
Owner

概要

実機(iOS Safari / Android Chrome)で「まだエラーになる画像」の原因を切り分けられるよう、?debug=true のときだけ console に出力するデバッグログ機構を追加し、写真の選択取り込み〜加工〜アップロードの各工程にログを仕込みました。

直前の #75(モバイルのメモリ枯渇・デコード失敗対策)でも解消しきれない画像があるため、リモートデバッグで失敗箇所と画像の特徴(ファイルメタ・サイズ・寸法・HEIC 判定・スタック)を追えるようにするのが目的です。

変更点

  • lib/debug-log.ts(新規): DebugLogger クラス(log / warn / error / dumpError / time / scope)と共通インスタンス debugLogenabled が false の間は全メソッド no-op で本番コストゼロ。dumpError は Error を name / message / stack に分解し、モバイルの remote console で潰れず中身が読めるようにする
  • デバッグ状態の一元管理: 既存の debugAtom(sticky・ページ遷移で保持)をそのまま真の状態として使用。React 外の画像処理パイプラインから参照できるよう、AppDebugUrlSync が atom 値を debug-log のモジュールフラグへミラーする
  • ログ挿入: UploadPage.ingestFiles(IndexedDB 退避・サムネ生成)/ UploadingPage.runPipeline(加工・セッション作成・送信)/ image-processing(decode 失敗・HEIC フォールバック)の失敗箇所に詳細ログを追加

使い方

受信URLに &debug=true を付けて開くと、以降の全工程が [FurDrop][...] プレフィックス付きで出力される(一度 ON にすれば遷移後も保持)。

Test plan

  • 実機(iOS Safari)で ?debug=true を付けて複数枚アップロードし、リモートコンソールに各工程のログが出る
  • ?debug=true なし(通常時)は console に何も出力されない
  • /upload?debug=true → 送信 → /uploading/done と遷移してもデバッグ出力が維持される
  • 失敗する画像で、ファイル名・type・サイズ・スタックが dumpError で確認できる

🤖 Generated with Claude Code

実機で「まだエラーになる画像」の原因を切り分けるため、デバッグ時のみ
console に出力するヘルパーを追加し、選択取り込み〜加工〜アップロードの
各工程にログを仕込む。

- lib/debug-log.ts: DebugLogger クラス (log/warn/error/dumpError/time/scope)。
  enabled が false の間は全メソッド no-op。dumpError は Error を
  name/message/stack に分解し、モバイルの remote console でも中身が読めるようにする
- デバッグ状態は既存の debugAtom (sticky・遷移で保持) で一元管理。React 外の
  パイプラインから参照できるよう、App の DebugUrlSync が atom 値を
  debug-log のモジュールフラグへミラーする
- UploadPage.ingestFiles / UploadingPage.runPipeline / image-processing に
  失敗箇所のログを追加 (ファイルメタ・サイズ・寸法・HEIC 判定・スタック)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kuu13580, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 43 minutes and 50 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 59642421-7914-4d4d-a8fd-3dc63b147822

📥 Commits

Reviewing files that changed from the base of the PR and between 2cb4fdd and 14a92bb.

📒 Files selected for processing (5)
  • frontend/src/App.tsx
  • frontend/src/lib/debug-log.ts
  • frontend/src/lib/image-processing.ts
  • frontend/src/pages/send/UploadPage.tsx
  • frontend/src/pages/send/UploadingPage.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/upload-debug-logger

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kuu13580
kuu13580 merged commit c03198d into main Jun 15, 2026
6 checks passed
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.

1 participant