Imagine file metadata is never updated when a variant is stored again, so mediaObjects keep a changed filter's old type and size
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #422 de @silverbackdan — fusionado
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 63/100
Línea de trabajo
Start by tracing ImagineEventListener::onStore() into FileInfoCacheManager::saveCache() and inspect how readStoredFilteredImageInfo uses that method. Check the existing tests for stored variants and cached metadata, then add coverage for storing the same (path, filter) again. Done means refreshed metadata reflects the stored file’s MIME type, size, and dimensions while the read path remains safe from concurrent inserts.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
FileInfoCacheManager::saveCache() returns early when a row already exists for the (path, filter):
if ($this->resolveCache($fileInfo->path, $fileInfo->filter)) {
return;
}
ImagineEventListener::onStore() goes through saveCache(). So when a variant is stored again, its metadata row keeps the old values. Changing a filter's format, quality or size and running imagine:generate writes the new files, but _metadata.mediaObjects keeps serving the old mimeType, fileSize and dimensions.
Seen in production (template alpha.25 → alpha.27, every filter switched to format: webp)
- Every variant now has a
.webpfile and a.webpcontentUrl. Its metadata row still saysimage/png/image/jpeg, with the old file size. - Example
filemedia objects for one image: original 2124 px PNG at 3.69 MB. Thegeneralrow saysimage/pngat 1.58 MB (the stored WebP is 41 KB). Thelargerow saysimage/png, 2124 px wide, at 4.69 MB (the stored WebP is 91 KB). @cwa/nuxt'ssrcsetkeeps one candidate per width, the smallest byfileSize. Herelargeand the original are both 2124 px wide, andlargeis recorded as the bigger file. So the original goes into thesrcsetin place oflarge. Retina screens then download the 3.7 MB PNG (12.7 s on a test request) in place of the 91 KB WebP.- This hits every image whose original is no wider than
large, which is most uploads.
Suggested fix
- Store events: a stored variant should replace its metadata.
onStore()could upsert, or delete the(path, filter)row before inserting.saveCache()can stay insert-only for the read path (readStoredFilteredImageInfo), where it guards against concurrent inserts. - Existing sites: add an upgrade note to delete the stale variant rows after a filter change, so they are re-read from the stored files on the next render:
then purge the HTTP cache. Alternatively,DELETE FROM _acb_imagine_cached_file_metadata WHERE filter <> '';imagine:generatecould refresh the metadata of any variant whose row doesn't match the stored file.
- Lenguaje dominante
- PHP
- Estrellas
- 32
- Forks
- 8
- Merge medio
- 40 min
- PR fusionados (30 d)
- 133
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de components-web-app/api-components-bundle
-
Codecov project status fails before the Behat coverage upload landsPosiblemente ocupada @silverbackdan la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 20/100
components-web-app/api-components-bundle#472 ·
Los mantenedores suelen responder en 1 día
-
Fixture builder: accept a PageBuilder or PageDataBuilder as the target of linkRoute(), linkIri() and redirect(to:)Posiblemente ocupada @silverbackdan la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
components-web-app/api-components-bundle#471 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
components-web-app/api-components-bundle#469 ·
Los mantenedores suelen responder en 1 día
-
Component groups: a maximum number of components (e.g. exactly one CTA)Posiblemente ocupada @silverbackdan la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
components-web-app/api-components-bundle#464 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
generate-fixtures: configurable asset store (local folder or Flysystem) with a content-hash manifest and pruningPosiblemente ocupada @silverbackdan la tomó hoy. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
components-web-app/api-components-bundle#462 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de components-web-app/api-components-bundle
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Automattic/blocks-engine#2866 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
community-scripts/ProxmoxVE#17944 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
EasyCorp/EasyAdminBundle#7861 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Good first issue: add laravel-inertia stack budget preset (Laravel 11 + Inertia.js + PHP 8.3)Abiertoenhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
backend gamification P0
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
semanadeinformatica/website#461 ·