Repository navigation
Fix/upload finish timeout - #100
Merged
alexanderoster merged 2 commits intoNov 5, 2026
Merged
Conversation
/upload/finish makes the server hash the whole stream, so its duration grows with the file size; on slow hardware such as a Raspberry Pi a large file exceeds the default 10 s request timeout. axios then aborted the request, the rejection was swallowed, and the upload widget stayed at 100 % although the upload never completed. The finish request of build and image uploads now runs without a timeout, like the chunk POSTs. A failed init, chunk or finish request calls the new AMCUploadState.failUpload(), which invokes _onError, so the frontend shows the failure instead of hanging.
An upload widget reuses one AMCUploadState, and the user can start a new upload while one is still running; the new upload takes over with a new upload ID. A failing request of the replaced upload (e.g. a finish for a 3MF that does not parse) then reset the upload ID and fired _onError, which silently stopped the newer upload. AMCUpload.failUpload() now only acts while its upload is the active one, as the chunk handlers already check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: uploads hanging at 100 % when the finish request is slow
Summary
/upload/finishmakes the server hash the whole stream, so it takes longer the bigger the file is. On slow hardware (e.g. a Raspberry Pi) a large file takes more than the default 10 s request timeout. axios aborts the request, the empty.catchswallows the error, and the upload widget stays at 100 % forever.Second commit: an upload widget reuses one AMCUploadState, and the user can start a new upload while one is still running. Now that failures are reported, a late failure of the replaced upload would stop the newer one. failUpload() therefore only acts while its upload is the active one, the same check the chunk handlers already do.
AMCUpload.failUpload(reason)
if this upload is still the active one
itemState.failUpload(reason)
Only Client/core changes, so both the Vue2 and the Svelte client get the fix.
Evidence
New Client/tests/uploadFinish.test.mjs (node:test, no new dependencies), covering build and image uploads:
After: 6/6 pass; the full cd Client/tests && npm test passes 14/14
Merge Danger
Client-only change with no API or data change. Revert the two commits to undo it.
If the server never answers, a finish request now waits indefinitely instead of failing after 10 s. The chunk requests already behave that way. Upload init, chunk and finish failures that used to be silently ignored now reach the widget's _onError.