-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Can't finalize a finalized MultipartFile #52
Comments
Hi @MekniWassime 👋 |
Thank you for the reply, although i m currently quite busy i will take a shot at making a reproduction sample |
Hi, I have the same problem when users upload multipart files with the expired token. By resending a request with a refreshed token the user will receive the My solution will be recreating a new stream during sending a second request. It will be hard since data property of Request class is dynamic and I'm not sure the data structure for all cases. In my fresh_dio_next package I have extended this package by adding extra checking of the token before sending . So the request will be processed the most of time. It's also should prevent sending a first invalid request with large data, which always will be failed and resending (Correct me if I'm wrong :D). |
Hi, @felangel |
@enioluciano Do you have a refresh token implementation? |
You can just reset the list in which you are storing the multipartfile after the request is made. |
My team and i are working on a mobile app that sometimes requires us to send multiple images to a nodejs server using FormData and MutipartFiles (part of the dio package) and recently we had to transition from sessions and cookies to Jwt tokens. and the transition was really seamless thanks to your package that honestly saved me days of work at least
but i ran into a problem and here's the scenario for simplicity
DioError [DioErrorType.other]: Bad state: Can't finalize a finalized MultipartFile.
(i will put the entire error message below)after doing some research on the matter i found out that you have to basically make a new FormData object out of the old FormData if you want to resend a request
a link of the most promising solution i found cfug/dio#482
here is how i implemented your interceptor
and here's the full error code with some of the
print
s that i did included (note that aside from MultipartFiles no other problem has occuredsome information about the environment and versions used
if more information could be provided i d be more than happy to provide them
The text was updated successfully, but these errors were encountered: