Task Says Done but the Download Isn't Ready? Split States
The button says “Complete,” but clicking download returns an empty file. Typically, this isn’t a matter of textual feedback; rather, the backend only logs that
Your progress bar says "Complete," you click download, and you get an empty file. This happens when a single "done" status hides several separate events: the computation finished, the output file exists, and the file meets the delivery requirements. This guide is for developers and product teams building document-processing features, including translation, who need the interface to match what has actually happened.
The usual cause is that the backend records only that the algorithm finished running, not whether the result was delivered. Splitting the status into distinct stages lets the frontend show accurate feedback at each point.
The examples here use synthetic samples and were verified in an isolated environment. They do not guarantee the same results for every real file or product. Before you process important files, keep the original copies and check the results against your own acceptance criteria.
Why is my download empty even though the task says "Complete"? The short answer
Track processing, product readiness, and acceptance as separate states, and only show "ready" once the file has been verified.
| Your situation | What to do | Why |
|---|---|---|
| The task shows "Complete" but the download is empty | Separate processing, product, and acceptance into distinct states | "Complete" alone only means the computation stopped |
| Users see a spinner after a failure | Show a clear failure status with its stage and cause | Failures must not hide behind a perpetual spinner |
| The download returns HTTP 200 but the file is wrong | Check the file type, size, parsing, and expected content | HTTP 200 can return a login page, error JSON, or blank document |
| You integrate translation into your platform | Show success only after the file is confirmed | Raw task status can mislead users about what they can download |
Splitting one status into several states
Why a single "done" flag fails
- The backend often logs only that the algorithm has finished.
- Nothing records whether the output was actually delivered.
- The frontend then reports success before the file is usable.
Accurate feedback requires breaking the status into discrete components.
The three events to track
Keep these three events separate, because they do not always happen at the same time:
- Processing completion: the computation has stopped.
- Product readiness: a locatable file is available.
- Acceptance completion: the file meets the delivery agreement.
Failures also need clear status indicators. Do not leave them behind a spinning icon.
Rejecting "jump-style" success
Do not jump straight from "running" to "success." Model the lifecycle as a composite state machine instead, with each state and transition defined explicitly.
from enum import Enum
class State(Enum):
PROCESSING = "processing"
ARTIFACT_READY = "artifact_ready"
VERIFIED = "verified"
FAILED = "failed"
def transition(state, event):
allowed = {
(State.PROCESSING, "stored"): State.ARTIFACT_READY,
(State.PROCESSING, "error"): State.FAILED,
(State.ARTIFACT_READY, "checks_passed"): State.VERIFIED,
(State.ARTIFACT_READY, "error"): State.FAILED,
}
if (state, event) not in allowed:
raise ValueError("invalid state transition")
return allowed[(state, event)]
s = transition(State.PROCESSING, "stored")
assert s is State.ARTIFACT_READY
assert transition(s, "checks_passed") is State.VERIFIED
assert transition(s, "error") is State.FAILED
try:
transition(State.PROCESSING, "checks_passed")
except ValueError:
pass
else:
raise AssertionError("cannot skip artifact readiness")
This example does not cover queue cancellation, re-review, or expired deletion. A production implementation should be built to match your business needs, rather than forcing every event into a simple success or failure binary.
Asynchronous messages can also arrive duplicated or out of order. Use versioning, transactions, and idempotency handling to keep the state correct.
Reference: Python enum
Making front-end messages match the facts
Each state should show only what is true at that moment, along with the actions that make sense for it:
| status | users can see | available actions |
|---|---|---|
| processing | is processing | view progress or cancel |
| artifact_ready | is checking the result | does not make a prior commitment to availability |
| verified | file is downloadable | Download and View Acceptance Instructions |
| failed | Failure Stage and Causes | repair by cause or retry |
Note that artifact_ready does not promise the file is available yet. Only verified should offer the download.
When the download succeeds but the content is wrong
An HTTP 200 response only means the request succeeded. The body may be a login page, an error JSON, or a blank document.
Acceptance testing should check at least:
- The file type
- The file size
- Whether the file can be parsed
- Whether the expected content is present
For translation, language integrity and terminology review are higher-level checks. Do not replace them with "the file can open."
Keeping status transparent when you add translation
If your platform connects to OmniDoc (Product Entry), your product should still keep its own storage and delivery status. Map the platform task's completion to "ready to receive results," and show success only after the file is confirmed. This gives users a more accurate picture than passing the raw task status straight through.
📊 At a glance
| Stage | What it means | Can the user download yet? |
|---|---|---|
| Processing completion | The computation has stopped | Not necessarily |
| Product readiness | A locatable file is available | Not necessarily, until acceptance |
| Acceptance completion | The file meets the delivery agreement | Yes |
🎯 Which approach fits you?
If you see "Complete" but cannot download anything
Split the status into processing, product, and acceptance, and show download only after acceptance.
If your users get stuck on a spinner after a failure
Add a failure state that shows the stage and cause, with repair or retry actions.
If you handle translated files
Check language integrity and terminology in addition to confirming that the file opens.
If you connect a third-party platform
Keep your own storage and delivery status, and show success only once the file is confirmed.
❓ FAQ
1. Why does my task show "Complete" when the file is missing?
"Complete" usually only means the backend finished running the algorithm. It does not confirm that the output was delivered.
2. Is an HTTP 200 response enough to trust a download?
No. The response can contain a login page, an error JSON, or a blank document, so check the file type, size, parsing, and content.
3. Do I need a separate "acceptance" state?
Yes, if you want to avoid offering a download before the file meets the delivery agreement. Processing and product readiness do not guarantee that.
4. How should I handle duplicate or out-of-order messages?
Use versioning, transactions, and idempotency handling so that the state stays correct.
📝 Summary
A task marked "Complete" does not guarantee a usable file. Track processing, product readiness, and acceptance as separate states, and show success only after the file is verified.
Try it now: upload a document and get it translated with the layout intact


