Skip to content

Prevent system sleep while transcriptions are queued - #1593

Merged
raivisdejus merged 3 commits into
chidiwilliams:mainfrom
wenhaoone:codex/prevent-sleep-while-queued
Aug 23, 2026
Merged

Prevent system sleep while transcriptions are queued#1593
raivisdejus merged 3 commits into
chidiwilliams:mainfrom
wenhaoone:codex/prevent-sleep-while-queued

Conversation

@wenhaoone

Copy link
Copy Markdown
Contributor

Summary

  • keep Windows and macOS awake while file transcriptions remain queued or running
  • add an enabled-by-default General preference to control sleep prevention
  • serialize queue activity across threads and make completion/cancellation cleanup stale-safe
  • add regression coverage for duplicate task IDs, forced cancellation, cross-thread ordering, and platform adapters

Testing

  • 51 passed across sleep inhibitor, queue worker, preferences, and settings tests
  • cross-thread MainWindow regression test passed
  • Windows native SetThreadExecutionState acquire/release smoke test passed
  • all 15 gettext catalogs compiled successfully
  • ruff check passed for the new module and tests
  • git diff --check passed

The full local suite was also attempted; its first end-to-end transcription case could not complete because this Windows environment does not have the CI-provided ffmpeg executable. The focused and integration tests covering this change pass.

Closes #1422.

@raivisdejus

Copy link
Copy Markdown
Collaborator

Nicely done @wenhaoone!
Thanks for your contribution

@raivisdejus
raivisdejus enabled auto-merge (squash) August 22, 2026 19:11
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.16867% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.60%. Comparing base (646c61b) to head (8a16724).

Files with missing lines Patch % Lines
buzz/sleep_inhibitor.py 90.19% 10 Missing ⚠️
buzz/widgets/main_window.py 77.77% 2 Missing ⚠️
buzz/file_transcriber_queue_worker.py 97.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1593      +/-   ##
==========================================
+ Coverage   83.46%   83.60%   +0.13%     
==========================================
  Files         110      111       +1     
  Lines       12472    12625     +153     
==========================================
+ Hits        10410    10555     +145     
- Misses       2062     2070       +8     
Flag Coverage Δ
Linux 82.73% <91.56%> (+0.12%) ⬆️
macOS 83.11% <90.36%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@raivisdejus
raivisdejus disabled auto-merge August 23, 2026 04:48
@raivisdejus
raivisdejus enabled auto-merge (squash) August 23, 2026 05:36
@raivisdejus
raivisdejus merged commit aaf9863 into chidiwilliams:main Aug 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: disable sleep mode on MacOS when items are in the Queue

2 participants