The scenario: the server may have finished before the client timed out
A document upload can reach storage and be accepted even when the client never receives the final response. The user sees a failure, but the server may already have a valid submission. A retry implementation has to answer a precise question: is this another attempt at the same operation, or a new operation that changes the accepted content?
The inspected Movo-X identity-review route uses a reserve-and-complete workflow with content-bound request identity. Five isolated route tests were rerun and passed for the selected source. This chapter focuses on the retry and storage boundary; it does not establish native-device behaviour or current production document availability.
Validate the request before it becomes a storage operation
The route first checks the request shape, selected document type, consent information and image representation. Invalid input is not a reason to reserve arbitrary storage or begin expensive image processing. The fields proposed by extraction are treated as suggestions and constrained independently of the image bytes.
That separation is useful in an implementation brief. Specify which errors the client can correct before retrying and which require a new accepted submission. A malformed request, an unauthorized recipient and an uncertain success should not all lead to the same automatic action. The user needs an appropriate next step, and the server needs an unambiguous operation identity.
Bind retry identity to the intended content
The reviewed source constructs a fingerprint from the selected person and document context, normalized fields and image digests. It submits that fingerprint through the reservation step before writing stored objects. This helps the receiving system distinguish an unchanged retry from a request whose content has changed while retaining the same client-side identifier.
An identifier alone is not a complete idempotency policy. If a user edits the document details or replaces one image, the system needs a defined response to that changed payload. The accepted meaning should be stable enough that an operator can explain why a retry returned the prior result or why a changed request needed a separate decision.
Authorize and reserve before expensive decoding or private writes
The inspected route obtains the reservation response before image normalization and object storage. Its denied-recipient test checks that refusal does not produce an object write. This is a concrete ordering property: expensive processing and private file operations follow the authorization decision rather than being speculative work performed for any submitted payload.
The test uses generated or deliberately invalid image bytes and a mocked API. It exercises the selected route behaviour in isolation, not the complete database authorization policy. A production acceptance plan still needs its own authorized and unrelated account cases. The useful claim here is the observed route-test result and the corresponding source order.
Return a completed result instead of rewriting accepted objects
When the reservation response says the operation is already complete, the route returns the recorded identity-review result before image processing and storage. The isolated retry test makes object replacement fail the test if it is attempted. That gives the retry path a specific invariant: a prior accepted submission is not casually recreated merely because the user repeated the request.
This is distinct from accepting an intentional new submission. A corrected image or changed person context needs the product’s normal versioning and review semantics. The implementation and client contract should make those cases distinguishable so the operator is not asked to infer user intent from two similar-looking upload events.
Complete only after the intended storage work
For a new accepted reservation, the route normalizes the images, writes the intended private objects and calls the completion operation. The generated-image test checks the ordering and that both required objects exist when completion is requested. It also checks removal of the synthetic source metadata marker from the processed output.
A storage-write result and an accepted document-review submission remain different states. The completion record ties the file work to the product workflow. If a client loses the response, it should recover the known operation state rather than infer that a missing acknowledgment means nothing happened. The exact recovery interface needs to match the client and server contract.
Do not delete objects merely because completion is uncertain
The route’s source comment explicitly preserves objects after an uncertain completion because the submission may have committed. Deleting those bytes in a generic error handler could turn a recoverable response problem into a broken accepted record. The safe cleanup decision requires knowledge of ownership and durable state, not just the exception caught by one process.
A useful follow-up rehearsal injects failures before storage, between writes, before completion and after an accepted completion whose response is lost. Record which objects and submission state are expected at each point. Those are proposed additional failure injections; the five rerun route tests cover their named cases and do not prove every possible interruption.
What the handover should make reproducible
Deliver the request-identity rules, content-change semantics, reservation/completion boundary and the state a client should inspect after an uncertain response. Include synthetic fixtures for denied input, unchanged retry, changed content and partial storage work. Keep the real document bodies and storage paths out of ordinary logs and public reports.
For a CTO, the outcome is a private-upload workflow with understandable recovery behaviour. The important engineering work is the relationship between user intent, object ownership and durable acceptance. A generic retry button or a successful file write cannot establish that relationship on its own.
Illustrative control flow
Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.
validate_and_normalize_request()
reservation = authorize_and_reserve(request_id, content_fingerprint)
if reservation.is_complete:
return reservation.accepted_result
for image in accepted_submission:
store_private(normalize(image), reservation)
return complete_submission(reservation)
# An uncertain response is investigated through durable state.
# It is not an instruction to delete possibly accepted objects.About this engineering series
Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.
Explore the Movo-X engineering series → · Related implementation experience →
Discuss a similar engineering problem
Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.
Discuss your project on WhatsApp ↗