Commit 2b818e0
fix(storage): Resolve MultipartRequest finalization error in retry mechanism (#1208)
When using StorageRetryController, failed uploads would trigger retries that attempted to reuse the same MultipartRequest object. Since MultipartRequest objects become finalized after the first send() call, subsequent retry attempts would throw "Can't finalize a finalized Request" StateError.
This fix creates a fresh MultipartRequest for each retry attempt by introducing a createRequest() factory function that generates new request objects with all the necessary headers, files, and fields configured correctly.
Fixes the retry functionality for file uploads with StorageRetryController, making it reliable for handling network failures during large file uploads.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent e8d40d6 commit 2b818e0
1 file changed
+19
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
172 | 177 | | |
173 | 178 | | |
174 | 179 | | |
| |||
178 | 183 | | |
179 | 184 | | |
180 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
181 | 190 | | |
182 | 191 | | |
183 | 192 | | |
| |||
0 commit comments