Skip to content

Fix frozen conversion queue and missing progress updates during CUE->CHD conversion - #155

Merged
ClausValcaTD merged 2 commits into
mainfrom
fix/cue-chd-conversion-progress-freeze-2978587420427434301
Oct 16, 2026
Merged

ClausValcaTD merged 2 commits into
mainfrom
fix/cue-chd-conversion-progress-freeze-2978587420427434301

Conversation

@ClausValcaTD

Copy link
Copy Markdown
Contributor

Summary of Changes:

  1. Real-time Stream Progress Parsing (core/ & gui/):

    • Refactored Converter._run in core/lib/src/converter.dart to run tools asynchronously via Process.start instead of blocking synchronously with Process.runSync.
    • Added stream line splitters in core/ (processStreamLines) and gui/ (splitStreamLines) that split stream chunks on RegExp(r'[\r\n]+'). This allows chdman progress lines that end with \r (without newline) to emit progress events and terminal logs live to the UI.
  2. Argument Tokenization & Quote Stripping (core/):

    • Added cleanCommandArgs and splitCommandArgs in core/lib/src/converter.dart to strip surrounding double or single quotes from path and command arguments before passing them as elements of List<String> args to Process.start.
  3. Queue State Transitions & Exception Handling (gui/):

    • Updated startConversion in gui/lib/controllers/home_controller.dart to explicitly transition job.status = JobStatus.converting before awaiting process execution.
    • Wrapped conversion execution in try / catch (e, stack) blocks to ensure any unhandled exceptions transition the job status to JobStatus.failed, log the error and stack trace to the terminal, and notify UI listeners.
  4. Exit Code & Stderr Error Reporting:

    • Captured full stderr output buffers and exit codes in Converter._run, setting descriptive job errors when external commands fail (e.g. chdman failed with exit code X: <stderr message>).
  5. Tests & Formatting:

    • Updated gui/pubspec.yaml intl dependency constraint to ^0.20.2.
    • Added unit tests in core/test/argument_parsing_test.dart and core/test/stream_progress_test.dart.
    • Verified that cd core && dart test (38 tests) and cd gui && flutter test (35 tests) pass cleanly.
    • Ran dart analyze (0 issues) and dart format ..

PR created automatically by Jules for task 2978587420427434301 started by @ClausValcaTD

- Convert Converter process execution from blocking Process.runSync to async Process.start
- Implement stream line parsers splitting on [\r\n]+ to process carriage return \r progress updates in real-time
- Add cleanCommandArgs and splitCommandArgs to strip surrounding quotes from argument lists before calling Process.start
- Update HomeController queue state transitions from queued to converting and wrap conversion in try/catch blocks
- Capture stderr buffers and exit codes for failed process executions
- Add unit tests for argument quote stripping and \r stream progress parsing

Co-authored-by: ClausValcaTD <193546948+ClausValcaTD@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…arden queue transitions

- Refactor Converter process execution from blocking Process.runSync to async Process.start
- Implement stream line parsers splitting on [\r\n]+ to process carriage return \r progress updates in real-time
- Add cleanCommandArgs and splitCommandArgs to strip surrounding quotes from argument lists before calling Process.start
- Update HomeController queue state transitions from queued to converting and wrap conversion in try/catch blocks
- Capture stderr buffers and exit codes for failed process executions
- Add unit tests for argument quote stripping and \r stream progress parsing

Co-authored-by: ClausValcaTD <193546948+ClausValcaTD@users.noreply.github.com>
@ClausValcaTD
ClausValcaTD merged commit 4bf7da4 into main Oct 16, 2026
1 check passed
@ClausValcaTD
ClausValcaTD deleted the fix/cue-chd-conversion-progress-freeze-2978587420427434301 branch October 16, 2026 09:44
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.

1 participant