Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make uploadResponse and uploadStatus accessible inside useItemErrorListener with ChunkedUploady #597

Closed
alexis-lanoix-sixthfin opened this issue Oct 4, 2023 · 4 comments
Assignees
Labels
bug Something isn't working completed enhancement New feature or request

Comments

@alexis-lanoix-sixthfin
Copy link

Is your feature request related to a problem? Please describe.
When using ChunkedUploady, based on my tests, it's not possible to get details about the server response in case of error inside the useItemErrorListener hook. Instead BatchItem.uploadResponse is always containing the string "At least one chunk failed".

Describe the solution you'd like
From the useItemErrorListener hook, there should be a way to get the server response details easily inside BatchItem.uploadResponse even when using ChunkedUploady (as when uploading without chunks using Uploady). It would also be nice to be able to retrieve the uploadStatus.

Describe alternatives you've considered
The workaround I am currently using is to get and store the server response from the formatServerResponse props and check against it later inside the useItemErrorListener hook but that's quite cumbersome and I don't think it would be that hard to make it accessible for chunked uploads as well looking at the code base:

Additional context
In the project I am currently working on, we are using ChunkedUploady for chunked uploads. We have recently implemented file type filtering on the server side by returning a 400 Bad Request in case of unsupported type. However, when we try to check for this specific case, we can't get either the uploadStatus or the uploadResponse from the BatchItem inside the useItemErrorListener hook.

@yoavniran
Copy link
Collaborator

hey @alexis-lanoix-sixthfin
thanks for the detailed information. I think its somewhere between a bug and an enhancement :)
In any case, I will look into exposing the error information to the Item so you can retrieve it from the error listener.

@yoavniran yoavniran self-assigned this Oct 4, 2023
@yoavniran yoavniran added bug Something isn't working enhancement New feature or request in-progress labels Oct 4, 2023
@yoavniran yoavniran added completed and removed bug Something isn't working labels Oct 8, 2023
@yoavniran
Copy link
Collaborator

@alexis-lanoix-sixthfin
a fix for this issue is now available in RC version: v1.6.0-rc.0
If you can, please give a try.

@alexis-lanoix-sixthfin
Copy link
Author

hey yoavniran,
I have tested it and it works great. Thanks for your responsiveness! :)

@yoavniran yoavniran added bug Something isn't working and removed in-progress labels Oct 9, 2023
@yoavniran
Copy link
Collaborator

great! thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants