Skip to content

TTSのRemote Config判定をプラットフォーム別キーのみに変更して旧バージョンへの影響を防ぐ - #6635

Merged
TinyKitten merged 1 commit into
devfrom
fix/tts-remote-config-platform-only
Aug 10, 2026
Merged

TinyKitten merged 1 commit into
devfrom
fix/tts-remote-config-platform-only

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

概要

Remote Config による TTS の有効/無効判定を、旧マスタースイッチ tts_enabled から切り離し、プラットフォーム別キー tts_enabled_ios / tts_enabled_android のみで行うように変更する。

従来は tts_enabled とプラットフォーム別キーの AND で判定していたため、tts_enabled: false で TTS を停止している状態から特定プラットフォームだけ再開するには tts_enabled を true に戻す必要があり、プラットフォーム別キーを解釈しない旧バージョンのアプリでも TTS が復活してしまう問題があった。判定を分離することで、旧バージョン向けの tts_enabled と対応バージョン向けのプラットフォーム別キーを独立して制御できるようにする。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • isTTSFeatureEnabled() を Platform.OS に応じた tts_enabled_ios / tts_enabled_android のみで判定するよう変更(iOS/Android 以外はフォールバック true)
  • tts_enabled のキャッシュ・取り込み処理と AND 合成ヘルパー isTTSPlatformEnabled() を削除し、TTS_PLATFORM_ENABLED_FALLBACK を TTS_ENABLED_FALLBACK へ一本化
  • REMOTE_CONFIG_KEYS.TTS_ENABLED と RemoteConfigResponse.tts_enabled は Worker 側との対応表として定義のみ残し、「旧バージョン専用キーで当バージョンは参照しない」旨をコメントで明記
  • src/lib/remoteConfig.test.ts のテストをプラットフォーム別キーベースへ全面移行。tts_enabled: false でもプラットフォーム別キーが true なら有効になること、tts_enabled: true でもプラットフォーム別キーが false なら無効になることを回帰テストとして追加
  • FxTTS.tsx / useTTSFeatureEnabled.ts および関連テストのコメント・describe 名を新しい判定基準に合わせて更新

回帰リスクと緩和策

  • リリース順序の依存: プラットフォーム別キー未配信時のフォールバックは true(利用可能)のため、/config/remote が tts_enabled_ios / tts_enabled_android を返さない状態で本変更をリリースすると、現在 tts_enabled: false で停止中の TTS が本バージョンでのみ有効化される。BFF(TrainLCD/BFF)で両キーの配信を先に有効化してからリリースすることで回避する。
  • 全プラットフォーム停止の操作変更: 全体停止は tts_enabled: false ではなく tts_enabled_ios / tts_enabled_android の両方を false にする操作へ変わる。この運用は REMOTE_CONFIG_KEYS および isTTSFeatureEnabled() のコメントに明記済み。
  • 判定範囲の限定: 変更は Remote Config の TTS 判定のみで、TTS の再生ロジック・ユーザー設定・他の Remote Config キーには手を入れていない。既存の FxTTS マウント制御と設定画面のトグル無効化はキルスイッチの購読経路をそのまま利用しており、挙動は不変(既存テストで担保)。

テスト

npm run lint / npm test / npm run typecheck をローカルで実行し、いずれも成功することを確認済み(215 suites / 2263 tests パス)。

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

関連Issue

スクリーンショット(任意)

Summary by CodeRabbit

  • 機能改善

    • 音声読み上げ(TTS)の有効・無効設定を、iOSとAndroidで個別に制御できるようになりました。
    • 各プラットフォームの設定が無効の場合、ユーザー設定が有効でもTTSの再生を停止します。
    • 対応する設定が配信されていない場合の動作を整理しました。
  • テスト

    • プラットフォーム別設定や各種フォールバック動作の検証を追加・更新しました。

@TinyKitten TinyKitten self-assigned this Aug 10, 2026
@github-actions github-actions Bot added the react label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6392db2e-8335-4486-99c3-4048cba86ae4

📥 Commits

Reviewing files that changed from the base of the PR and between 9a682b3 and 790bd25.

📒 Files selected for processing (6)
  • src/components/FxTTS.test.tsx
  • src/components/FxTTS.tsx
  • src/hooks/useTTSFeatureEnabled.ts
  • src/lib/remoteConfig.test.ts
  • src/lib/remoteConfig.ts
  • src/screens/TTSSettings.test.tsx

📝 Walkthrough

Walkthrough

Changes

TTS Remote Config制御

Layer / File(s) Summary
Remote Configキャッシュ更新
src/lib/remoteConfig.ts
旧キーtts_enabledのキャッシュ処理を削除し、プラットフォーム別キーの設定説明と取得処理を更新しました。
プラットフォーム別TTS判定
src/lib/remoteConfig.ts, src/components/FxTTS.tsx, src/hooks/useTTSFeatureEnabled.ts
iOSとAndroidでは各キーを判定します。未設定時と未知プラットフォームではTTSを有効として扱います。
TTS判定テスト更新
src/lib/remoteConfig.test.ts, src/components/FxTTS.test.tsx, src/screens/TTSSettings.test.tsx
プラットフォーム別キーの有効化、無効化、フォールバック、非真偽値、キャッシュリセットのテストを更新しました。

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

  • TrainLCD/MobileApp#6427: 同じRemote ConfigとTTSテストで、単一キーからプラットフォーム別キーへ変更しています。
  • TrainLCD/MobileApp#6631: 同じプラットフォーム別TTSスイッチの判定ロジックとテストを更新しています。

Poem

うさぎが跳ねて、キーを分け
iOS、Android、値を受け
古いスイッチは静かに眠り
未設定ならTTSは走る
テストの耳もよく澄んだ 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed タイトルは、TTSのRemote Config判定をプラットフォーム別キーへ変更し、旧バージョンへの影響を防ぐ主変更を明確に示しています。
Description check ✅ Passed 概要、変更内容、テスト結果、変更種別、回帰リスクを記載しており、テンプレートの必須情報を十分に満たしています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tts-remote-config-platform-only

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

@TinyKitten
TinyKitten merged commit 229c661 into dev Aug 10, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the fix/tts-remote-config-platform-only branch August 10, 2026 02:15
This was referenced Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant