-
Notifications
You must be signed in to change notification settings - Fork 43
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
Bad state: Can't finalize a finalized MultipartFile #15
Comments
please test my PR #16 |
Hi @vimaxwell , After test in a test server I own, the issue persists... |
@wolru , unfortunately the PR #17 don't fix the issue.... Although, the PR occasionally the error occurs on the first, second... attempt, not only on the last Here is the stacktrace
And here, is the screenshot of the error with the original plugin's code: |
Ow, this is the PHP code (in Laravel) that I'm using to test (inside a controller and api route):
|
Hey @aweiand ! I've added the fix for this issue. Now to enable retrying you should add multipart data like this (using final formData =
FormData.fromMap({'file': MultipartFileRecreatable.fromFileSync('README.md')});
await dio.post<dynamic>(
'https://multipart.free.beeceptor.com/post500',
data: formData,
); See the full example in the test: dio_smart_retry/test/multipart_retry_tests.dart Lines 32 to 61 in 63a3bdd
@aweiand Could you please check your case again using src from the current repo? |
It's the best solution I've found for today, but it's not very good, because it's not supported |
While dio doesn't support |
@rodion-m, in a short test, it was suceffull! I will design a full test in the sequence. Thank's!! In my opinion you don't has to throw an exception generically, maybe only on some listed error code? |
Ok, thank you for testing!
If formdata has a type |
Is It possible to add support for fromString method as well? Currently if we have both data as well as Files in the same request, retry is not working. My current code is
So can we have an option like
|
Hey @helloalbin ! Certainly, feel free to add it as a PR :) |
fixed with #42. |
Hi,
I'm using the latest packages:
When I post a file to the server and, it accepts only after first attemp, the error occours... here a simplified code:
The text was updated successfully, but these errors were encountered: