Skip to content

Add debug request parameters#51

Open
UniquePanda wants to merge 4 commits intomainfrom
50-add-debug-request-parameters
Open

Add debug request parameters#51
UniquePanda wants to merge 4 commits intomainfrom
50-add-debug-request-parameters

Conversation

@UniquePanda
Copy link

@UniquePanda UniquePanda commented Mar 18, 2026

Long description

This adds a new option: includeDebugRequestParameters (+ the corresponding debugUploadTaskIdParameterName and debugIsFinalCheckParameterName).
When includeDebugRequestParameters is set to true, requests to the server (GET for checking is a chunk is already uploaded, POST for uploading a chunk) will contain an additional parameter that contains the id of the upload task that was sending the request.
If the request was sent in the context of the final check, an additional parameter is sent to indicate that.

These parameters can be used to debug problems on the server-side, e.g. you are able to see if an upload task stopped its work at some point.

Additional changes:

  1. Previously a chunk was always aborted after the GET request. This reset all its info which was then set again immediately after when the POST request was started. This was never needed and now broke the debug params, because the upload task ID was not available for the POST request. This is fixed by explicitly checking for the 204 return code in the chunks status function and returning status PENDING when the chunk was tested and the XHR request returned 204. Previously this scenarios was only caught by the default branch of the switch-case.
  2. I changed the description of all existing request parameter options in the readme, because they all talked about POST parameters, but all of the parameters are also send when it's a GET request. So I changed it to "request parameters" instead.

TODOs

  • I added an entry to the CHANGELOG.md for this PR

@UniquePanda UniquePanda self-assigned this Mar 18, 2026
@UniquePanda UniquePanda changed the title 50 add debug request parameters Add debug request parameters Mar 18, 2026
UniquePanda added a commit that referenced this pull request Mar 18, 2026
@UniquePanda UniquePanda marked this pull request as ready for review March 18, 2026 09:48
@UniquePanda UniquePanda force-pushed the 50-add-debug-request-parameters branch from ba38398 to 4c87f1d Compare March 18, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant