The display-name fallback reaches the user's save dialog and has never run #169

Closed
opened 2026-09-02 02:14:53 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-09-02 02:14:53 +00:00 (Migrated from github.com)

The display-name fallback can reach the user's save dialog, untested

ConversionWorker.kt:63 — inputData.getString(KEY_DISPLAY_NAME) ?: "input". JaCoCo: mi=2,
1 of 2 branches missed. Every test in app/src/test/java/org/libremediaconverter/work supplies
KEY_DISPLAY_NAME, so the fallback has never run.

It is not cosmetic. The value feeds the foreground-notification title and, through
outputNameFor(displayName, spec) (:147), the KEY_SUGGESTED_NAME in the success output — i.e.
the filename offered in the user's save dialog. The same read appears again at :343 in
getForegroundInfo.

The work

One test. RefusedJobTest already has the fixture:
workerWithout(key) (app/src/test/java/org/libremediaconverter/work/RefusedJobTest.kt:199-211),
built by map subtraction. Run a worker without KEY_DISPLAY_NAME, assert the job succeeds and
KEY_SUGGESTED_NAME starts with input.

Land this in the same PR as the runMedia3OrFallBack ticket — same file, same harness.

Acceptance: the mutation that must go red

Change the fallback string from "input" to anything else.

## The display-name fallback can reach the user's save dialog, untested `ConversionWorker.kt:63` — `inputData.getString(KEY_DISPLAY_NAME) ?: "input"`. JaCoCo: `mi=2`, 1 of 2 branches missed. Every test in `app/src/test/java/org/libremediaconverter/work` supplies `KEY_DISPLAY_NAME`, so the fallback has never run. It is not cosmetic. The value feeds the foreground-notification title *and*, through `outputNameFor(displayName, spec)` (`:147`), the `KEY_SUGGESTED_NAME` in the success output — i.e. the filename offered in the user's save dialog. The same read appears again at `:343` in `getForegroundInfo`. ## The work One test. `RefusedJobTest` already has the fixture: `workerWithout(key)` (`app/src/test/java/org/libremediaconverter/work/RefusedJobTest.kt:199-211`), built by map subtraction. Run a worker without `KEY_DISPLAY_NAME`, assert the job succeeds and `KEY_SUGGESTED_NAME` starts with `input`. Land this in the same PR as the `runMedia3OrFallBack` ticket — same file, same harness. ## Acceptance: the mutation that must go red Change the fallback string from `"input"` to anything else.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMediaConverter#169