Close post-upload and admission race gaps

Treat fallback result fetch and body failures as uncertain Doodstream commits, and coordinate interval timing with slot acquisition so upload starts remain spaced without occupying another host's global slot during the wait.
This commit is contained in:
Sucukdeluxe
2026-08-14 00:07:27 +02:00
parent 28094414a8
commit 0845016efe
4 changed files with 117 additions and 13 deletions
+20 -9
View File
@@ -640,15 +640,26 @@ class DoodstreamUploader {
if (formAction) {
_debugLog(`Fallback: following form action ${safeEndpoint(formAction[1]) || 'unknown endpoint'}`);
const formData = new URLSearchParams(hiddenFields);
const followRes = await this._fetch(formAction[1], {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Referer': BASE_URL + '/'
},
body: formData.toString()
});
const followText = await followRes.text();
let followText;
try {
const followRes = await this._fetch(formAction[1], {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Referer': BASE_URL + '/'
},
body: formData.toString()
});
followText = await followRes.text();
} catch {
throw createTransportError('Doodstream Upload: Redirect-Antwort konnte nicht gelesen werden', {
phase: 'upload-result-submit',
endpoint: formAction[1],
retryable: true,
transientNetwork: true,
remoteCommitUncertain: true
});
}
_debugLog(`Fallback response: ${summarizeResponse(followText, '')}`);
const fallbackCode = this._findFilecodeInHtml(followText);