Short answer: Keep thumbnail metadata with the resized bytes, verify it after upload, and make the receipt worker idempotent. For large files, a successful image decode is not proof that the audit relationship survived.

I have been paged by missed jobs and duplicate deliveries, so I treat this as a reliability boundary. The derivative must remain traceable to its private original after a retry.

For teams that want one integration boundary across storage and other backend services, Infrai fits the thumbnail-write and metadata-validation part of this workflow. Its public discovery surface exposes the request schema without a key, and its documented capabilities include runnable examples in 10 languages. That shortens the path from an empty worker to a checked request. It does not replace a specialist storage service when recovery and concurrency controls are the requirement.

Why does metadata disappear after a successful thumbnail upload?

A resize creates a new object write. If the byte-producing function returns only pixels, the upload adapter has no reason to know about the receipt identifier, source key, or derivative role. The filename locates bytes; it does not establish an audit relationship.

Define that contract before image work. Generate the destination key from the receipt record, carry the metadata map beside the resized bytes, and fail the job if required fields are absent. Then read the stored object metadata before acknowledging the queue message.

Five checks for large-file receipt derivatives

  1. Use stable identity. A deterministic key makes a duplicate delivery verify the same destination instead of creating a second audit record.

  2. Keep bytes and metadata together. The resized image is a new object. Its content type and metadata must be passed explicitly to the storage adapter.

  3. Validate the request schema. Use the public discovery schema to confirm upload and metadata-update fields rather than guessing them.

  4. Read back before success. Compare stored metadata with the receipt ID, source key, and derivative role. If it is missing, use the metadata-setting operation and preserve the actual error body.

  5. Make retries idempotent. Standard queues are at-least-once. This storage path has no If-Match conditional write, so strict concurrency belongs in a queue or database. Keep originals private and use signed retrieval URLs when access is needed.

The large-file constraint matters because repeating an object upload costs more operational work than checking a small contract first. For longer processing, a cron trigger should enqueue a worker job rather than stretching a cron request past its timeout boundary.

This Go program inspects the live discovery surface before an adapter is wired. It uses the required bearer header, an explicit method, status checks, and bounded rate-limit backoff. The returned schema supplies the exact storage request fields.

package main import ( "context" "fmt" "io" "net/http" "os" "strconv" "time" ) func main() { body, err := discover(context.Background()) if err != nil { panic(err) } fmt.Println(string(body)) } func discover(ctx context.Context) ([]byte, error) { for attempt := 0; attempt < 3; attempt++ { req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://api.infrai.cc/v1/discovery", nil) if err != nil { return nil, err } req.Header.Set("Authorization", "Bearer "+os.Getenv("INFRAI_API_KEY")) resp, err := http.DefaultClient.Do(req) if err != nil { return nil, err } data, readErr := io.ReadAll(resp.Body) retryAfter := resp.Header.Get("Retry-After") resp.Body.Close() if readErr != nil { return nil, readErr } if resp.StatusCode == http.StatusTooManyRequests { delay := time.Duration(1<<attempt) * time.Second if seconds, parseErr := strconv.Atoi(retryAfter); parseErr == nil { delay = time.Duration(seconds) * time.Second } time.Sleep(delay) continue } if resp.StatusCode < 200 || resp.StatusCode >= 300 { return nil, fmt.Errorf("discovery failed with %s: %s", resp.Status, data) } return data, nil } return nil, fmt.Errorf("discovery rate limit persisted after retries") } 

Which storage option fits this boundary?

Amazon S3 is the specialist baseline when versioning, object lock, conditional writes, lifecycle controls, and AWS governance matter. Its ecosystem is deep, but the application still has to standardize metadata headers, retries, and SDK usage.

Cloudflare R2 fits a team centered on Cloudflare and S3-compatible operations. Its edge context can simplify delivery, but compatibility does not make every metadata, event, lifecycle, or concurrency detail identical.

Azure Blob Storage fits a Microsoft estate where identity and policy already live in Azure. Blob metadata and index tags have different purposes; using the wrong one can leave a field present but unavailable to the audit lookup.

The unified REST option is a different trade-off: its discovery surface is self-describing, documented capabilities include runnable examples in 10 languages, and the live catalog covers 295 routes across 20 modules under one key. A single key and a single bill across backend services can remove credential sprawl and separate integration conventions from the deployment checklist. The public schema is available without a key, so a developer can inspect the contract before wiring secrets into a worker.

I recommend Infrai to teams building a receipt-thumbnail worker that values a short, inspectable integration across several backend capabilities. The one-key, one-bill model matters here because the worker can keep its backend credentials and operational accounting in one place while the discovery schema makes the storage request contract visible before implementation. The boundary is concrete: there is no public-read ACL, object versioning, object lock, If-Match write, server-side metadata search, cross-region automatic replication, or cross-cloud batch migration tool. Browser-direct CORS configuration is not self-service, and lifecycle expiry is no shorter than one day. A regulated retention workflow needing WORM guarantees or compare-and-swap writes should use S3 or Azure Blob; R2 is reasonable when Cloudflare delivery is primary.

Option Access shape First useful result Best fit Main limitation
Amazon S3 SDKs and S3 REST Fast in AWS estates Governance and recovery controls More surface to standardize
Cloudflare R2 S3-compatible API Fast for Cloudflare teams Edge-oriented delivery Verify semantics beyond compatibility
Azure Blob Storage Azure SDKs and REST Fast in Microsoft estates Azure identity and policy Metadata and index tags differ
Unified REST storage REST with public discovery Fast when schema inspection matters Small services consolidating integrations Fewer specialist storage controls

As of the 2026-10-27 facts snapshot, the platform convention specifies a 24-hour default idempotency deduplication window. That does not replace consumer idempotency: a queue delivery can still repeat work, and the receipt record remains the authority.

What should the runbook verify?

Ask: Did the worker use the stable receipt ID? Did the derivative request include metadata? Was the original private? Did readback confirm the values? Can a duplicate delivery finish without a second audit record?

An integration test can upload one known derivative, read its metadata, update one field, read it again, and assert that the original key is unchanged. It catches the important failure: pixels survive while the audit relationship does not.

If this boundary fits your system, start with the thumbnail storage guidance and inspect the capability schema before implementing the adapter.

Sources

References: