Skip to content

feat: cancel export subtitle translations#1701

Open
ringoshiina wants to merge 1 commit into
mengxi-ream:mainfrom
ringoshiina:codex/subtitle-export-cancel
Open

feat: cancel export subtitle translations#1701
ringoshiina wants to merge 1 commit into
mengxi-ream:mainfrom
ringoshiina:codex/subtitle-export-cancel

Conversation

@ringoshiina

Copy link
Copy Markdown
Contributor

Summary

  • Add an export-scoped cancellation group for translated subtitle SRT export and cancel that group when the downloader is disposed.
  • Teach the subtitle translation queues to reject pending and executing work by cancellation group, including a short-lived late-enqueue guard for requests that arrive after cancellation.
  • Keep ungrouped subtitle/page translation behavior unchanged while separating cancellation groups from the existing request de-dupe/cache path.

Scope

This PR intentionally does not:

  • abort provider HTTP requests that are already in flight;
  • add a user-facing cancel button;
  • add background or resumable export behavior.

Validation

  • pnpm exec vitest run src/entrypoints/background/__tests__/translation-queues.test.ts
  • pnpm exec vitest run src/entrypoints/subtitles.content/__tests__/translated-subtitles-downloader.test.ts src/utils/subtitles/processor/__tests__/translator.test.ts
  • pnpm exec vitest run src/utils/request/__tests__/request-queue.test.ts src/utils/request/__tests__/batch-queue.test.ts
  • pnpm exec tsc --noEmit --pretty false
  • pnpm exec eslint src/entrypoints/background/translation-queues.ts src/entrypoints/background/__tests__/translation-queues.test.ts src/entrypoints/subtitles.content/translated-subtitles-downloader.ts src/entrypoints/subtitles.content/__tests__/translated-subtitles-downloader.test.ts src/utils/message.ts src/utils/request/request-queue.ts src/utils/request/batch-queue.ts src/utils/subtitles/processor/translator.ts src/utils/subtitles/processor/__tests__/translator.test.ts
  • git diff --check
  • pre-push hook: @read-frog/extension:lint, @read-frog/extension:type-check, @read-frog/extension:test (159 test files, 1341 tests)

@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b4fe70c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@read-frog/extension Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ringoshiina ringoshiina changed the title [codex] Cancel export subtitle translations feat: cancel export subtitle translations Jun 17, 2026
@github-actions github-actions Bot added the feat label Jun 17, 2026
@ringoshiina ringoshiina force-pushed the codex/subtitle-export-cancel branch 2 times, most recently from 1794748 to 06da06c Compare June 17, 2026 13:21
@ringoshiina ringoshiina force-pushed the codex/subtitle-export-cancel branch from 06da06c to b4fe70c Compare June 17, 2026 13:34
@ringoshiina ringoshiina marked this pull request as ready for review June 17, 2026 13:53
@github-actions github-actions Bot added the contrib-trust:moderate PR author trust score is 30-59. label Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Contributor trust score

32/100 — Moderate

This score estimates contributor familiarity with mengxi-ream/read-frog using public GitHub signals. It is advisory only and does not block merges automatically.

Outcome

Score breakdown

Dimension Score Signals
Repo familiarity 14/35 commits in repo, merged PRs, reviews
Community standing 6/25 account age, followers, repo role
OSS influence 3/20 stars on owned non-fork repositories
PR track record 9/20 merge rate across resolved PRs in this repo

Signals used

  • Repo commits: 3 (author commits reachable from the repository default branch)
  • Repo PR history: merged 3, open 1, closed-unmerged 2
  • Repo reviews: 0
  • PR changed lines: 705 (+664 / -41)
  • Repo permission: read
  • Followers: 1
  • Account age: 95 months
  • Owned non-fork repos considered: max 1, total 1 (ringoshiina/learn-quiz-skill (1), ringoshiina/shadowrocket-backcn-rules (0), ringoshiina/QuickShot_v2 (0))

Policy

  • Low-score review threshold: < 30
  • Auto-close: score < 20 and changed lines > 1000
  • Policy version: v1.1

Updated automatically when the PR changes or when a maintainer reruns the workflow.

@taiiiyang taiiiyang requested a review from ananaBMaster June 22, 2026 12:27
@mengxi-ream

Copy link
Copy Markdown
Owner

We have been busy with other features recently. This PR appears to modify the capabilities of our core underlying queue, which is quite risky, and we currently don't have time for a detailed review. I will mark this PR as "on hold" for now. When we have more time in the future, we will come back to review it. Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contrib-trust:moderate PR author trust score is 30-59. feat on-hold

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants