@ajuarezso/sui-design-system 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13971,12 +13971,28 @@ class SuiImgRetry {
|
|
|
13971
13971
|
this.retry(this.img.src);
|
|
13972
13972
|
}
|
|
13973
13973
|
}
|
|
13974
|
-
retry(src) {
|
|
13975
|
-
/* Re-asignar el MISMO src es no-op en algunos engines; limpiar primero
|
|
13976
|
-
fuerza un load nuevo. Los fetch fallidos no se cachean, así que el
|
|
13977
|
-
reintento sí va a la red. */
|
|
13974
|
+
async retry(src) {
|
|
13978
13975
|
if (this.img.src !== src)
|
|
13979
13976
|
return; // el binding ya lo cambió — no pisar
|
|
13977
|
+
/* Cache envenenado: si la red se cortó a mitad de descarga, el WebView
|
|
13978
|
+
puede cachear el cuerpo TRUNCADO bajo el header immutable — y todos los
|
|
13979
|
+
reintentos leen esa copia corrupta del disco (bug real 2026-07-10:
|
|
13980
|
+
cover que nunca cargaba en un solo device). `fetch cache:'reload'`
|
|
13981
|
+
re-descarga desde la red y REEMPLAZA la entrada del disk cache para
|
|
13982
|
+
esta URL; el <img> siguiente ya lee la copia sana. Requiere CORS GET
|
|
13983
|
+
en el bucket (ya configurado). Best effort: si falla (offline), el
|
|
13984
|
+
retry normal corre igual. NO limpiar el cache completo (onDestroy o
|
|
13985
|
+
similar) — eso mata el beneficio nativo de no re-descargar nada. */
|
|
13986
|
+
if (this.retries >= 2) {
|
|
13987
|
+
try {
|
|
13988
|
+
await fetch(src, { mode: 'cors', cache: 'reload' });
|
|
13989
|
+
}
|
|
13990
|
+
catch { /* offline */ }
|
|
13991
|
+
if (this.img.src !== src)
|
|
13992
|
+
return;
|
|
13993
|
+
}
|
|
13994
|
+
/* Re-asignar el MISMO src es no-op en algunos engines; limpiar primero
|
|
13995
|
+
fuerza un load nuevo. */
|
|
13980
13996
|
this.img.removeAttribute('src');
|
|
13981
13997
|
this.img.src = src;
|
|
13982
13998
|
}
|