Business · Product · Technology · AI

Automatic retry, manual retry and app restart are different Android recovery cases

A source walkthrough of Movo-X photo upload state, transient-failure classification and the scope of a stable request identity within an automatic retry loop.

Work directly with Omer Muneer Qazi · Reviewed 29 November 2026

The scenario: the user presses retry after an interrupted upload

An Android upload fails and the user tries again. That can mean an automatic repeat inside the same operation, an intentional manual retry after the operation stopped, or a new attempt after the app process restarted. Those cases may use the same button label, but they do not necessarily share the same bytes, request identity or server state.

The reviewed Movo-X photo repository makes several of these boundaries visible in source. This chapter explains the automatic loop, local progress states and manual retry entry point. Six selected JVM photo-upload/contract tests have now passed in an isolated pinned Android build using cached offline dependencies. They cover retry-policy examples, byte-write progress, synthetic mock-service behaviour and response decoding. No device installation or production upload was performed; request-identity and process-restart cases remain source analysis and proposed acceptance.

Classify transient failures before repeating work

The inspected retry helper treats selected network and service conditions as retryable while allowing validation or permission failures to stop. This distinction keeps an automatic loop from repeatedly sending a request whose input or authority needs a user decision. A temporary transport problem and an intentional refusal should not produce the same recovery behaviour.

The delay is computed through a bounded local policy with server wait information as one input where available. A complete implementation review should inspect that policy together with the caller and its tests rather than infer compliance from a comment. The chapter does not claim that every server backoff instruction or failure category has been independently validated on a device.

The rerun policy fixture checks network backoff, selected service failures, exhausted attempts and refusal of selected client errors. It explicitly expects a long server wait value to be capped by the local maximum. That confirms the reviewed policy, while alignment with a provider’s intended wait contract still needs a separate decision. The test does not establish that an arbitrary server Retry-After value is fully honoured.

Keep one request identity within the automatic loop

In the inspected repository, the upload operation creates a request identifier before entering its automatic attempt loop. Each repeat in that loop uses the same identifier. That gives the server a way to recognize repeated transport attempts belonging to one operation instead of treating every attempt as a new user action.

A focused test should simulate an uncertain success followed by a transport retry and inspect the server’s idempotency behaviour. Counting how many times the client called the upload function is not sufficient: the accepted result and durable server state also matter. The source shows the client’s identity scope, while a full acceptance result would require the relevant client/server test.

Make progress describe the current attempt

The repository exposes processing, uploading, failed and done states, with upload progress and attempt context. Those states help the editor and other UI surfaces describe the operation without pretending that an in-flight request has already become an accepted photo. The upload result is handled separately from the progress callback.

For the product team, define what the user sees when progress restarts for another attempt, when the operation stops and when the accepted server version becomes available. A progress ring reaching its end is not itself proof of durable acceptance. The state should follow the outcome the application actually received and the recovery path it can offer.

A rerun progress-body fixture writes synthetic bytes into an in-memory sink and checks exact byte equality, monotonic reported progress and final completion. This is evidence about the request-body writer. It does not prove that those bytes reached a remote server or became the accepted photo.

Manual retry is a new entry into the operation

The reviewed manual-retry method obtains the retained bytes and starts the upload operation again. Because the operation creates its request identifier on entry, this is not the same identity scope as another iteration of the existing automatic loop. That is a concrete design boundary to account for when evaluating uncertain completion.

A manual retry may be an intentional new operation under the product’s semantics. The important point is to define that meaning and its server behaviour rather than assume every action labelled “retry” is identical. Test the case where the earlier request might already have succeeded, and make the accepted photo version and user-visible result understandable.

In-memory pending work is different from a durable queue

The inspected repository retains pending upload bytes in memory for its manual retry path. An in-memory structure is not evidence that the same operation survives process death, device restart or a fresh sign-in. Durable offline work requires an additional design for storage, operation identity, ownership and cleanup.

This distinction lets a team scope the current feature honestly and decide whether stronger recovery is necessary. A user may need to select the source again after a restart, while an existing running operation can still perform bounded transport retries. Those can be acceptable different journeys if the interface and acceptance record describe them clearly. The chapter does not claim that a durable background-upload queue was verified.

Test cancellation separately from ordinary failure

The source explicitly propagates coroutine cancellation rather than treating it as an ordinary retryable exception. That helps preserve the caller’s control over the operation lifecycle. Cancellation, server refusal and loss of network are different events and should have different consequences for the task and its progress state.

A useful isolated Android test plan includes cancellation during upload, a temporary network failure, an intentional permission denial and a manual retry after the automatic policy ends. Add process restart as its own acceptance case if that recovery is in scope. Record whether each case was exercised in a unit test, emulator or physical device; the selected JVM cases are newly reported here, while cancellation, full repository state transitions, emulator and physical-device outcomes remain untested in this review.

What to include in the operating handover

Deliver a recovery-state map that distinguishes an automatic attempt, manual operation and restarted application. Identify where bytes and request identity live, which outcomes stop the loop and how the UI learns the accepted server version. Keep server idempotency and client retry evidence linked without claiming they are the same component.

For a CTO commissioning mobile work, that map makes a vague “uploads retry” requirement testable. The implementation can be assessed against the actual recovery promise, and additional durability can be scoped deliberately. A working happy-path upload is useful evidence, but it does not by itself establish the behaviour of every interrupted mobile journey.

Illustrative control flow

Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.

operation_id = new_request_identity()
while automatic_policy_allows_attempt:
    try:
        result = upload(bytes, operation_id)
        show_accepted_result(result)
        stop
    catch transient_error:
        wait_using_reviewed_retry_policy()
    catch cancellation_or_permanent_error:
        stop_according_to_the_operation_contract()

# Manual retry and process restart are separate entry points.
# Their identity and persistence semantics need explicit tests.

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 ↗
WhatsApp Omer about this project ↗