deps: update esbuild to 0.27.4, rollup to 4.60.0, vite to 7.3.1
deps: update esbuild to 0.27.4, rollup to 4.60.0, vite to 7.3.1 - bump esbuild and all platform-specific binaries from 0.25.10 to 0.27.4 - bump rollup and all platform-specific binaries from 4.52.3 to 4.60.0 - bump vite from 7.1.7 to 7.3.1 (esbuild peer dep updated to ^0.27.0) - bump dompurify from 3.2.7 to 3.3.3 web: improve cover image retry logic - increase maxRetries default from 3 to 5 - reduce initial retryDelay from 1000ms to 500ms - implement exponential backoff: delay = retryDelay * 2^(retryCount - 1) - add detailed logging for retries and final failure rust: minor cleanup - remove unused imports (watch, Url, AudioSegment, SyncMarker) - add tracing debug logs for cache file requests - handle missing files gracefully with warning + client retry hint - add #[allow(async_fn_in_trait)] where needed
This commit is contained in:
@@ -10,7 +10,7 @@ export function useCoverImage(
|
||||
imageUrl: Ref<string | null | undefined>,
|
||||
options: CoverImageOptions = {},
|
||||
) {
|
||||
const { maxRetries = 3, retryDelay = 1000, forceReload = true } = options;
|
||||
const { maxRetries = 5, retryDelay = 500, forceReload = true } = options;
|
||||
|
||||
const imageLoaded = ref(false);
|
||||
const imageError = ref(false);
|
||||
@@ -66,6 +66,9 @@ export function useCoverImage(
|
||||
if (retryCount.value < maxRetries) {
|
||||
retryCount.value++;
|
||||
|
||||
// Backoff : 500ms, 1s, 2s, 4s, 8s — rapide au début pour les covers
|
||||
// en cours de téléchargement, plus espacé ensuite pour les erreurs réseau
|
||||
const delay = retryDelay * Math.pow(2, retryCount.value - 1);
|
||||
setTimeout(() => {
|
||||
if (!currentUrl.value) return;
|
||||
|
||||
@@ -74,7 +77,7 @@ export function useCoverImage(
|
||||
currentUrl.value,
|
||||
retryCount.value,
|
||||
);
|
||||
}, retryDelay * retryCount.value); // Exponential backoff
|
||||
}, delay);
|
||||
} else {
|
||||
console.error(
|
||||
`[useCoverImage] Max retries (${maxRetries}) reached for: ${currentUrl.value}`,
|
||||
@@ -102,8 +105,15 @@ export function useCoverImage(
|
||||
|
||||
// Retry if we haven't reached max retries
|
||||
if (retryCount.value < maxRetries) {
|
||||
const delay = retryDelay * Math.pow(2, retryCount.value);
|
||||
console.log(
|
||||
`[useCoverImage] Scheduling retry ${retryCount.value + 1}/${maxRetries} in ${delay}ms for: ${currentUrl.value}`,
|
||||
);
|
||||
retryLoad();
|
||||
} else {
|
||||
console.error(
|
||||
`[useCoverImage] Giving up after ${maxRetries} retries for: ${currentUrl.value}`,
|
||||
);
|
||||
imageError.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user