debug(wake): RVS-Log in endConversation — sichtbar machen ob re-arm greift
Stefan beobachtet dass Wake-Word nach Conversation manchmal nicht re-armt. endConversation hatte bisher kein RVS-Logging — wir waren beim Diagnose blind. Loggt jetzt: - 'endConversation called but state=X → noop' (state-Mismatch) - 'endConversation called, calling OpenWakeWord.start()' (Eintritt) - 'OpenWakeWord.start() OK → state=armed' (Erfolg) - 'OpenWakeWord.start() FAIL: ... → state=off' (Native-Fehler) - 'fallback: nativeReady=false → state=off' (kein Native-Modul) Damit sehen wir im naechsten Test welcher Pfad gegriffen hat und ob das Native-Modul ueberhaupt aufgerufen wurde.
This commit is contained in:
@@ -346,19 +346,34 @@ class WakeWordService {
|
|||||||
* Ohne: zurueck zu 'off'.
|
* Ohne: zurueck zu 'off'.
|
||||||
*/
|
*/
|
||||||
async endConversation(): Promise<void> {
|
async endConversation(): Promise<void> {
|
||||||
if (this.state !== 'conversing') return;
|
if (this.state !== 'conversing') {
|
||||||
|
// Nicht in conversing — typ. nach App-Resume bevor Streaming endete.
|
||||||
|
// Trotzdem loggen damit wir's im Diagnostic sehen.
|
||||||
|
import('./logger').then(m => m.reportAppDebug('wake.end',
|
||||||
|
`endConversation called but state=${this.state} → noop`)).catch(()=>{});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
import('./logger').then(m => m.reportAppDebug('wake.end',
|
||||||
|
`endConversation called, nativeReady=${this.nativeReady}, calling OpenWakeWord.start()`)).catch(()=>{});
|
||||||
if (this.nativeReady && OpenWakeWord) {
|
if (this.nativeReady && OpenWakeWord) {
|
||||||
try {
|
try {
|
||||||
await OpenWakeWord.start();
|
await OpenWakeWord.start();
|
||||||
console.log('[WakeWord] Konversation zu Ende — zurueck zu armed');
|
console.log('[WakeWord] Konversation zu Ende — zurueck zu armed');
|
||||||
|
import('./logger').then(m => m.reportAppDebug('wake.end',
|
||||||
|
`OpenWakeWord.start() OK → state=armed, keyword=${this.keyword}`)).catch(()=>{});
|
||||||
ToastAndroid.show(`Lausche wieder auf "${KEYWORD_LABELS[this.keyword]}"`, ToastAndroid.SHORT);
|
ToastAndroid.show(`Lausche wieder auf "${KEYWORD_LABELS[this.keyword]}"`, ToastAndroid.SHORT);
|
||||||
this.setState('armed');
|
this.setState('armed');
|
||||||
return;
|
return;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
console.warn('[WakeWord] re-arm fehlgeschlagen:', err);
|
console.warn('[WakeWord] re-arm fehlgeschlagen:', err);
|
||||||
|
import('./logger').then(m => m.reportAppDebug('wake.end',
|
||||||
|
`OpenWakeWord.start() FAIL: ${err?.message || err} → state=off`,
|
||||||
|
)).catch(()=>{});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('[WakeWord] Konversation zu Ende — Ohr aus');
|
console.log('[WakeWord] Konversation zu Ende — Ohr aus');
|
||||||
|
import('./logger').then(m => m.reportAppDebug('wake.end',
|
||||||
|
`fallback: nativeReady=${this.nativeReady} → state=off`)).catch(()=>{});
|
||||||
ToastAndroid.show('Mikro aus', ToastAndroid.SHORT);
|
ToastAndroid.show('Mikro aus', ToastAndroid.SHORT);
|
||||||
this.setState('off');
|
this.setState('off');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user