fix(android): drainingTts identity check, mark stopped on WebSocket failure

- Codex P2: drain coroutine now only clears drainingTts if it's the
  same instance (=== check), preventing a newer drain from being
  unreachable by stopTts.
- Codex P2: set stopped=true on WebSocket onFailure so subsequent
  sendText calls are rejected and stale state doesn't persist.
This commit is contained in:
Greg Mousseau 2026-02-28 14:37:36 -05:00 committed by Ayaan Zaidi
parent ccca99c472
commit ba430cc65b
1 changed files with 1 additions and 0 deletions

View File

@ -178,6 +178,7 @@ class ElevenLabsStreamingTts(
override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {
Log.e(TAG, "WebSocket error: ${t.message}")
stopped = true
cleanup()
}