Files
LibreMediaConverter/app/src/main/java
JMR-devandClaude Opus 5 99bd961022 Force the last five failure branches
The previous commit called five branches unforceable. That was wrong on all
five, and the reasoning behind it was lazy rather than investigated.

Three were described as needing a SAF grant revoked mid-job. They do not: a
content URI whose authority does not exist reaches exactly the same null
branch as one whose permission was withdrawn, and constructing one is a single
line. That now covers the conversion input, the join inputs, and the publish
destination.

One was described as unreachable through ConcatWorker.request(). True, but
irrelevant -- a worker is just input Data, and WorkManager will run one built
without the input array. That is also what a version-skewed queue entry would
look like after an app update, so it is worth covering rather than dismissing.

One was described as Media3-internal. An output path whose parent directory
does not exist makes Transformer.start() fail synchronously, and the engine
has to surface that as a rejected suspension. The test asserts specifically
that it is not a timeout: hanging would be far worse than throwing, because
the worker would sit holding a foreground service indefinitely.

The assertions check outcomes rather than exception types. Whether a resolver
returns null or throws is a provider implementation detail; what matters is
that the job fails cleanly and carries a message, instead of taking down the
worker.

Every failure branch in the conversion and join paths is now forced.
40 instrumented tests on a Pixel 10 Pro XL and 66 unit tests, 0 failures, with
the only skips being the opt-in benchmark.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 10:02:36 -05:00
..