Repository navigation
iOSで日本語TTS完了前に英語TTSへ進む不具合を修正 - #6381
Merged
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughiOSの ChangesiOS音声再生位置補正
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
TinyKitten
marked this pull request as ready for review
July 10, 2026 22:19
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/utils/ttsAudioPlayer.test.ts`:
- Around line 313-315: 両テストに、0秒へのリセット時に保存済み位置へフォールバックする分岐の直接検証を追加してください。まず
emitStatus で currentTime を10秒に設定し、次に mock.player.currentTime を0へ変更して
didJustFinish と currentTime 30秒の通知を発火し、seekTo
が10秒で呼ばれることを検証してください。対象テストと関連する再生状態処理を確認し、正の player.currentTime
を使う既存ケースだけに依存しないようにします。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 979b651f-a617-4bd2-b932-cfb3199e3ff3
📒 Files selected for processing (2)
src/utils/ttsAudioPlayer.test.tssrc/utils/ttsAudioPlayer.ts
4 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
iOSで日本語TTSの再生完了前に英語TTSへ進み、日本語アナウンスへ割り込む不具合を修正します。
変更の種類
変更内容
expo-audioのiOS実装が完了イベントのcurrentTimeを常にdurationで上書きする挙動を考慮根本原因は、早期完了イベントでも
currentTime === durationとなるため、既存の終端判定が途中終了を正常終了と誤認していたことです。回帰リスクとして、完了イベント受信時の位置取得に失敗すると再生完了が遅れる可能性があります。プレイヤー本体、直前の状態更新、イベント報告値の順にフォールバックし、位置通知がない短い音声は従来どおり完了として扱うことで影響を限定しています。
テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること実行結果:
npm exec -- jest --runInBand src/hooks/useTTS.test.ts src/utils/ttsAudioPlayer.test.ts: 2スイート、40テスト成功npm run lint: 成功npm run typecheck: 成功git diff --check: 成功Windowsでは既存の
npm testに含まれるUnix形式のTZ=UTCを直接解釈できないため、PowerShellで同じ環境変数を設定して関連Jestテストを実行しました。全テストスイートは未実行です。関連Issue
なし
スクリーンショット(任意)
UI変更なし