fix(scene): resume chunk downloads after proxy interruptions
Whole-file loading still failed after adding caching because the public proxy interrupted large GLB response bodies. Download validated 1 MiB ranges, retry transient failures up to three attempts, and persist completed chunks so reloads resume from their last boundary. Add regression cases observed failing before the change for interrupted downloads, cross-reload resume, and temporary HTTP failures. Verify range integrity, full-cache reuse, permanent errors, and storage fallback.
This commit is contained in:
@@ -32,12 +32,13 @@ export function reportProgress(update) {
|
||||
const done = values.filter(item => item.stage === 'ready').length;
|
||||
const loaded = values.reduce((sum, item) => sum + item.loaded, 0);
|
||||
const cached = values.filter(item => item.stage === 'cache').length;
|
||||
const retrying = values.some(item => item.stage === 'retry');
|
||||
const parsing = values.some(item => item.stage === 'parse');
|
||||
const downloading = values.some(item => item.stage === 'download');
|
||||
progress.max = Math.max(1, values.length);
|
||||
progress.value = done;
|
||||
title.textContent = `正在载入场景资源 ${done} / ${values.length}`;
|
||||
detail.textContent = `${parsing ? '正在解析模型' : downloading ? '正在下载资源' : cached ? '正在读取本地缓存' : '正在准备场景'} · 已读取 ${formatBytes(loaded)}`;
|
||||
detail.textContent = `${retrying ? '连接中断,正在从断点重试' : parsing ? '正在解析模型' : downloading ? '正在下载资源' : cached ? '正在读取本地缓存' : '正在准备场景'} · 已读取 ${formatBytes(loaded)}`;
|
||||
}
|
||||
|
||||
export function finishLoading() {
|
||||
|
||||
Reference in New Issue
Block a user