A meal photo upload needs visible stages for preparing, transferring and confirming the result.
Build the example
Use a synthetic photo and an upload endpoint that validates type and size. Resize locally where appropriate, retain the selected file long enough for retry and report byte progress only when the transport exposes it. Once bytes are sent, show a separate processing state until the server confirms completion.
Use a fake upload that reports 25%, 50%, 100%, then waits before confirming. During that wait, show processing and retain the ability to recover from a timeout. Make the server reject a file whose extension disagrees with its bytes. The client should display a clear reason rather than repeatedly retrying a permanent validation error.
Watch the failure boundary
Set an upper bound on prepared file size and make retries reuse the processed copy when possible. Avoid keeping original photos longer than needed. Validate the actual bytes at the server boundary and confirm access to the resulting image independently of the client’s reported upload progress.
Verify the behavior
Throttle the network and cancel midway through the upload. Check that cancellation releases local work and leaves no ambiguous saved record. Retry a request after losing the success response. Reuse a request identifier or an existing upload record so the retry does not create another meal entry.
Sources
Technical references checked .




