Repository navigation
fix: bind recorder signals to owned process identity #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1177,6 +1177,11 @@ def gui_discard(self) -> None: | |
| """Laufende Aufnahme verwerfen, ohne zu transkribieren.""" | ||
| if self.state == "RECORDING": | ||
| self.audio_recorder.discard() | ||
| if self.audio_recorder.is_recording(): | ||
| self.show_tray_error(t("error.recording.title"), t("error.recording.stop_failed").format( | ||
| error="Aufnahme-Prozess konnte nicht sicher gestoppt werden." | ||
| )) | ||
| return | ||
| self._recording_routes_to_compose = False | ||
| self.current_workflow = None | ||
| self._set_state("IDLE", "discarded via gui") | ||
|
|
@@ -1195,8 +1200,8 @@ def _stop_recording_and_process(self) -> None: | |
| route_to_compose = ( | ||
| self._recording_routes_to_compose and self._compose_voice_routing_enabled() | ||
| ) | ||
| self._recording_routes_to_compose = False | ||
| wav_path = self.audio_recorder.stop() | ||
| self._recording_routes_to_compose = False | ||
| if not wav_path: | ||
| logger.warning("No audio was recorded") | ||
| self.show_tray_warning("Blitztext", "Keine Audioaufnahme erfasst.") | ||
|
|
@@ -1240,6 +1245,8 @@ def _stop_recording_and_process(self) -> None: | |
| except AudioRecorderError as e: | ||
| logger.error("Failed to stop recording: %s", e) | ||
| self.show_tray_error(t("error.recording.title"), t("error.recording.stop_failed").format(error=e)) | ||
| if self.audio_recorder.is_recording(): | ||
| return | ||
|
Comment on lines
+1248
to
+1249
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
After a transient stop failure, Useful? React with 👍 / 👎. |
||
| self._recording_routes_to_compose = False | ||
| self.current_workflow = None | ||
| self._set_state("IDLE", "recording stop failed") | ||
|
|
@@ -1504,6 +1511,11 @@ def show_tray_warning(self, title: str, message: str) -> None: | |
| def quit_app(self) -> None: | ||
| logger.info("Quitting application...") | ||
| self.audio_recorder.discard() | ||
| if self.audio_recorder.is_recording(): | ||
| self.show_tray_error(t("error.recording.title"), t("error.recording.stop_failed").format( | ||
| error="Aufnahme-Prozess konnte nicht sicher gestoppt werden." | ||
| )) | ||
| return | ||
| self.stop_hotkey_worker() | ||
| if self._tts_window is not None: | ||
| self._tts_window.close() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the app is killed or crashes during a manual
./run.shsession, the exec'dparecchild has no parent-death signal or persistent liveness channel and can continue recording. On the next launch, this cleanup treats the live child's PID file as an unowned marker and deletes it, allowing another recorder to start against the same WAV path while the orphan continues capturing. Preserve safe cross-process exclusion or arrange for the child to terminate with its parent rather than silently forgetting it.Useful? React with 👍 / 👎.