Skip to content

fix(app): keep render state consistent#7

Open
z2z23n0 wants to merge 3 commits into
OpenMOSS:mainfrom
z2z23n0:fix/render-state-consistency
Open

fix(app): keep render state consistent#7
z2z23n0 wants to merge 3 commits into
OpenMOSS:mainfrom
z2z23n0:fix/render-state-consistency

Conversation

@z2z23n0

@z2z23n0 z2z23n0 commented Jul 10, 2026

Copy link
Copy Markdown

Problem

Subtitle rendering was not isolated from other job operations:

  • subtitle updates were accepted while FFmpeg was rendering, so the finished MP4 could contain older subtitles than the current job state;
  • duplicate render requests started multiple full render workers for the same job;
  • restarting the service during rendering restored an otherwise editable job as failed, even when its subtitle data was intact.

Changes

  • Reject subtitle updates with HTTP 409 while a job is rendering, and keep the Web UI out of edit mode during that state.
  • Make the render state transition atomic, set rendering before the worker starts, reject duplicate render requests with HTTP 409, and restore the previous state if thread startup fails.
  • Recover interrupted render jobs with valid subtitle data to waiting_review so users can edit or retry; other interrupted processing states still recover as failed.

The work is split into three focused commits, one for each failure mode.

Impact

Rendered output can no longer silently fall behind saved subtitle content, duplicate FFmpeg work is avoided, and a server restart no longer makes completed subtitle work inaccessible in the Web UI.

Validation

  • python -m pytest -q tests/test_app_api.py (6 passed)
  • python -m pytest -q (30 passed)
  • git diff --check origin/main...HEAD

@z2z23n0 z2z23n0 marked this pull request as ready for review July 10, 2026 13:53
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