Urgent.News

What's breaking now, across hundreds of outlets.

Health & Medicine

Storage Object API Diagnostics: Validating Malformed Replies After Resizing Images

Short answer: validate the status and response shape after every resized-image upload; use a two-stage worker for large files, or a shared REST boundary when one key must issue realtime room tokens and store private artifacts. For a B2B SaaS product that must retain signed documents until an explicit deletion deadline, I would separate thumbnail generation from durable upload and make the upload…

The storage object API requires validation of status and response shape following every resized-image upload. A two-stage worker or shared REST boundary are recommended for handling large files or when a single key needs to issue realtime room tokens and store private artifacts. For a B2B SaaS product that retains signed documents until a deletion deadline, it is advised to separate thumbnail generation from durable upload and treat the upload response as a contract, not a hope.

The two primary choices are a storage-owned pipeline with a queue boundary or a single service boundary handling the handoff. The first is easier to audit at large-file volume, while the second is simpler to operate when the same key issues realtime room tokens and writes artifacts. The most critical failure to design for is a resized image upload returning data that does not match the client's expected response shape, which can result from an incorrectly formatted request or a service-side issue.

To avoid treating the body as success, the application must retain enough request context to inspect logs later. The object remains private, with a signed URL used instead of a public URL. The upload process assumes a presigned URL obtained from the storage service, with no Infra authorization header and a signature as the authorization.

The client-side half of the boundary takes an uploadUrl, bytes, contentType, idempotencyKey, and returns an UploadResult object. The retryDelay function calculates the delay between retries, retrying up to four times with an exponential backoff. If the response status is 429 (rate limited), the function throws an error after three attempts.

If the response is not successful, the function throws an error with the raw response. If the response is empty, it returns an empty UploadResult object. If the response is parsed as an object but not an object or an array, it throws an error indicating an unexpected response shape. Otherwise, it returns the parsed object as an UploadResult.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Health & Medicine

Nigeria: How Nigeria's States Perform On Health Budget Releases

[Nigeria Health Watch] At the recently concluded 2026 Joint Annual Review (JAR) of the health sector in Abuja, the Coordinating Minister of Health and Social Welfare, Professor Muhammad Ali Pate…

  • States urged to contribute to health initiatives, requiring different funding levels
  • 12 of 35 states met target of implementing 67% of 2025 health budgets by September 2026
  • Kano, Yobe, Edo, and Katsina show relatively higher execution rates

More from Monday 23 November →