revert(byse): drop the v3.3.78 truncated-host rejection (added cost, no benefit)

v3.3.78 rejected upload-server hosts ending in the bare ".filemoon" label so the
lookup would retry for a valid server. In practice byse is currently returning a
truncated host for its WHOLE pool, so the rejection found nothing to fall back to and
turned every byse upload into a slow "Kein Upload-Server erhalten: OK" (6x2.5s server
retry per file) instead of the fast ENOTFOUND fail it had before. That is a worse UX
with zero upside while byse is down, so revert to the v3.3.77 behavior.

The premise (byse returns a MIX of good and truncated hosts, skip the bad ones) is
unverified; the evidence is byse returning truncated hosts for everything. And the
correct upload domain is NOT safely determinable from outside: a swarm of filemoon-brand
TLDs resolve (filemoon.eu/.me/.xyz/.art/.nl, kerapoxy.cc, moonmov.pro, ...) but the ones
probed are parked/squatted (parklogic landers, shared catch-all certs), and byse's real
response is only visible with a valid key. Guessing a TLD would point uploads at a parking
page or a third party, so we do not.

lib/hosters.js is now byte-identical to v3.3.77. The v3.3.77 fixes (5xx/ECONNRESET treated
as transient -> no failover cascade/blacklist; the /api/file/list path fix) are kept.
ENOTFOUND remains transient, so byse's outage fails clean (retry same account, no cascade)
with the actual unresolvable host shown in the message. Suite 311/311.

When byse restores its server pool (returns complete hostnames), uploads resume
automatically with no client change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Administrator 2026-06-19 02:31:57 +02:00
parent 4c0adabfb1
commit 4f2bd25426
2 changed files with 0 additions and 15 deletions

View File

@ -8,7 +8,6 @@ const API_TIMEOUT = 45000; // 45 seconds
const SERVER_RETRY_ATTEMPTS = 6; const SERVER_RETRY_ATTEMPTS = 6;
const SERVER_RETRY_DELAY_MS = 2500; const SERVER_RETRY_DELAY_MS = 2500;
const LAST_UPLOAD_SERVERS = new Map(); const LAST_UPLOAD_SERVERS = new Map();
const TRUNCATED_UPLOAD_HOST = /(^|\.)filemoon$/i;
function appendRawQuery(url, rawQuery) { function appendRawQuery(url, rawQuery) {
const parsed = new URL(url); const parsed = new URL(url);
@ -80,7 +79,6 @@ function normalizeAbsoluteUrl(raw, apiBase) {
try { try {
const parsed = new URL(candidate); const parsed = new URL(candidate);
if (!['http:', 'https:'].includes(parsed.protocol)) return null; if (!['http:', 'https:'].includes(parsed.protocol)) return null;
if (TRUNCATED_UPLOAD_HOST.test(parsed.hostname)) return null;
return parsed.href; return parsed.href;
} catch { } catch {
return null; return null;

View File

@ -32,19 +32,6 @@ describe('hosters helpers', () => {
assert.equal(url, 'https://delivery-hydra.voe-network.net/upload/01'); assert.equal(url, 'https://delivery-hydra.voe-network.net/upload/01');
}); });
it('rejects byse truncated upload hosts (TLD dropped) so the lookup retries for a valid server', () => {
assert.equal(__test.extractUploadServerUrl({ result: 'https://s1065.filemoon/upload/01' }, 'https://api.byse.sx'), null);
assert.equal(__test.extractUploadServerUrl({ result: 's1070.filemoon' }, 'https://api.byse.sx'), null);
assert.equal(__test.extractUploadServerUrl({ result: 'https://filemoon/upload/01' }, 'https://api.byse.sx'), null);
});
it('keeps a complete byse upload host (real TLD present) untouched', () => {
assert.equal(
__test.extractUploadServerUrl({ result: 'https://s1065.filemoon.sx/upload/01' }, 'https://api.byse.sx'),
'https://s1065.filemoon.sx/upload/01'
);
});
it('parseDoodstreamResult tolerates null/non-object payload without throwing', () => { it('parseDoodstreamResult tolerates null/non-object payload without throwing', () => {
// Direct callers may bypass uploadFile's normalisation. The parser must // Direct callers may bypass uploadFile's normalisation. The parser must
// never throw on bad input — empty fields are the contract. // never throw on bad input — empty fields are the contract.