핫키 press/release race condition 수정
- _handleRelease: 200ms 딜레이 제거 → 즉시 stopSession() (딜레이 중 새 press가 와서 세션 꼬이는 버그 수정) - _resetToIdle: 200ms 딜레이 제거 → 즉시 IDLE 복귀 (딜레이 때문에 다음 핫키가 안 먹히는 버그 수정)
This commit is contained in:
parent
18d5fef594
commit
84b9d906be
1 changed files with 7 additions and 11 deletions
|
|
@ -536,14 +536,10 @@ class VoiceModeService extends EventEmitter {
|
||||||
this._audioStarted = false
|
this._audioStarted = false
|
||||||
this._errorEmitted = false
|
this._errorEmitted = false
|
||||||
|
|
||||||
// 약간의 딜레이 후 IDLE로 전이 (UI 애니메이션용)
|
// 즉시 IDLE로 전이 (딜레이는 race condition 유발)
|
||||||
setTimeout(() => {
|
|
||||||
if (!this._session) {
|
|
||||||
this._setRecognitionState(RecognitionState.IDLE)
|
this._setRecognitionState(RecognitionState.IDLE)
|
||||||
this._setAudioState(AudioState.IDLE)
|
this._setAudioState(AudioState.IDLE)
|
||||||
}
|
}
|
||||||
}, 200)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── 에러 처리 ──────────────────────────────────────────
|
// ── 에러 처리 ──────────────────────────────────────────
|
||||||
|
|
||||||
|
|
@ -621,10 +617,10 @@ class VoiceModeService extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _handleRelease(action: VoiceAction): Promise<void> {
|
private async _handleRelease(_action: VoiceAction): Promise<void> {
|
||||||
if (action.mode === 'dictation' && this.isActive) {
|
if (_action.mode === 'dictation' && this.isActive) {
|
||||||
// Dictation: hold-to-talk — release로 종료 (200ms 딜레이)
|
// Dictation: hold-to-talk — release로 즉시 종료
|
||||||
await new Promise<void>((resolve) => setTimeout(resolve, 200))
|
// Speakly 패턴: 딜레이 없이 즉시 stop (딜레이가 race condition 유발)
|
||||||
await this.stopSession()
|
await this.stopSession()
|
||||||
}
|
}
|
||||||
// HandsFree: release 무시
|
// HandsFree: release 무시
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue