app v1.2.0: cancel with confirmation, queue dedupe by content hash

- Pending/uploading rows get a cancel button; every cancel is confirmed
  in a dialog and the source file is always kept — only a confirmed
  upload deletes originals. The in-flight HTTP transfer aborts
  immediately (async OkHttp call instead of blocking execute()).
- Enqueue refuses content whose SHA-256 is already pending/uploading,
  so sharing or picking the same file twice no longer uploads it twice
  in parallel (content URIs are opaque; the hash is the identity).
- Cancel/finish races resolved with conditional DB updates: a cancel
  landing mid-flight keeps the source; a cancel after completion is
  refused with a toast instead of flipping a finished row.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Michal
2026-10-02 00:29:42 +01:00
parent 81d5f33acc
commit ec2a332c88
10 changed files with 243 additions and 33 deletions

View File

@@ -24,11 +24,21 @@ server-side before it is accepted.
the server is detected by a `HEAD` before any bytes are sent; the item is
marked *Duplicate · already on server* and nothing is re-uploaded or
overwritten. Different content is a different hash, i.e. a different file —
not a duplicate.
not a duplicate. The queue dedupes the same way: content whose hash is
already pending or uploading is refused at enqueue time ("already in the
queue"), so adding the same file twice — even via two different content
URIs — never uploads it twice in parallel.
- **Cancel keeps the original.** A pending or in-flight upload can be
cancelled from its queue row; every cancel asks for confirmation so it can't
happen by accident. Cancelling aborts the transfer and discards the working
copy, but never deletes the source file — only a confirmed upload does that.
A cancel that races a finishing upload loses gracefully: if it lands first,
the source is kept even though the bytes reached the server; if the upload
finished first, the app says so and nothing is flipped.
- **Entry points.** Share sheet (`ACTION_SEND`), "Open with" on a downloaded
file (`ACTION_VIEW`), and an in-app file picker. "Clear history" (app-bar
button) drops finished, duplicate and failed rows; in-flight uploads keep
running.
button) drops finished, duplicate, failed and cancelled rows; in-flight
uploads keep running.
## Parts