You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(upload): 404 for a block whose upload no longer exists #279
Storage.uploadPart returns early when no uploads row matches the id (lib/storage.ts:335):
if(!upload)return
The block route (routes/devstoreaccount1/upload/[uploadId].put.ts) then answers 201 as if the block was stored. The client keeps going, and the missing part only shows up later as a failed finalize or a broken restore, with nothing in the logs pointing at the dropped block.
The row can be gone while a client is still uploading:
cleanup:uploads deletes uploads whose last finished part is older than one minute, so a client that pauses between blocks or has one slow block can lose its upload.
completeUpload deletes the row, so a retried or late block after finalize hits this path.
abandonUpload deletes it after a failed part.
Proposed fix
Throw a 404 from the route when the upload does not exist, so the client sees the failure on the block that caused it. Add a test: a PUT to an unknown upload id returns 404 and writes nothing to storage.
Related: #275 touches the same route but leaves this behavior unchanged.
Activity