fix(talk): cancel button now stops audio playback #21

Merged
m3tam3re merged 1 commits from fix/talk-cancel-button into master 2026-07-02 19:44:49 +02:00
Collaborator

Bug: Die Poll-Loop bricht nach 0.2s ab, weil > die ACTION_FILE sofort als leere Datei erstellt. [ -f ] trifft sofort zu → grep cancel findet nichts → break → mpv läuft unbeaufsichtigt weiter.

Fix: [ -f ][ -s ] (non-empty check). Die Datei wird erst befüllt, wenn der User auf "Abbrechen" klickt.

Der Fix war ursprünglich auf feat/talk-package gepusht, aber PR #18 wurde vorher gemerged.

Bug: Die Poll-Loop bricht nach 0.2s ab, weil `>` die ACTION_FILE sofort als leere Datei erstellt. `[ -f ]` trifft sofort zu → `grep cancel` findet nichts → `break` → mpv läuft unbeaufsichtigt weiter. Fix: `[ -f ]` → `[ -s ]` (non-empty check). Die Datei wird erst befüllt, wenn der User auf "Abbrechen" klickt. Der Fix war ursprünglich auf feat/talk-package gepusht, aber PR #18 wurde vorher gemerged.
m3ta-chiron added 1 commit 2026-07-02 19:44:18 +02:00
The shell '>' redirect creates ACTION_FILE immediately as an empty file.
The poll loop checked [ -f ] (exists) instead of [ -s ] (non-empty),
so it matched on the first 0.2s iteration, found no 'cancel' string,
and broke out of the loop — leaving mpv running with no listener.

[ -s ] only returns true once notify-send writes 'cancel' to the file
(i.e. when the user actually clicks the Abbrechen action).
m3tam3re merged commit 9e96e92cfe into master 2026-07-02 19:44:49 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m3tam3re/nixpkgs#21