Thumbnail logo detection ignores logos already recorded in manifest.shared
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
Línea de trabajo
Lee el bucle que deja los logos compartidos en site/thumbs.mjs:311-318 y sharedImageIds en site/lib/thumbs.mjs:162-172; después, revisa la prueba existente de sharedImageIds en site/lib/lib.test.mjs. Añade una prueba para un registro nuevo cuyo hash ya exista en shared y ejecuta npm test. La tarea se considera terminada cuando el nuevo registro se mueve a shared y la prueba pasa.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
The three-or-more shared-hash rule that keeps publisher logos out of thumbnails only counts records fetched in the current run, so a logo that was already dropped into manifest.shared is accepted again when a single new entry from the same site is fetched.
Where
site/thumbs.mjs:311-318(logo drop loop)site/thumbs.mjs:263-266(shared skip)site/lib/thumbs.mjs:162-172(sharedImageIds)
Details
for (const id of sharedImageIds(thumbs)) { // counts hashes in `thumbs` only
shared[id] = thumbs[id];
delete thumbs[id];
pending.delete(id);
}
for (const id of Object.keys(thumbs)) delete shared[id];
Records dropped in an earlier run live in shared, not thumbs, so they never count toward the limit again. The existing test (site/lib/lib.test.mjs, the sharedImageIds case) only covers three records sitting in thumbs together.
Impact
A publisher's site-wide logo or social card is published as an asset preview with a "Preview image shown under " credit, which is the case the shared-hash rule (#132) exists to block.
Steps to reproduce
- Entries A, B and C on one site share an og:image; a run drops them into
manifest.shared. - Add entry D from the same site (or change A's
url). - Run
node site/thumbs.mjs: D's image hash appears once inthumbs, below the limit, so D keeps the logo. Pure check:sharedImageIds({ D: { hash: "h" } })is empty even whensharedholds three records with hashh.
Suggested fix
Count hashes across { ...shared, ...thumbs } and drop only the ids that are in thumbs; or keep a set of known logo hashes and reject any fetched image whose hash is in it.
Acceptance criteria
- A newly fetched record whose hash matches a hash already in
sharedis moved toshared - Unit test: one new record plus an already recorded shared hash
Getting started
- Relevant files:
site/thumbs.mjs,site/lib/thumbs.mjs,site/lib/lib.test.mjs - Run the tests:
npm test; the full local gate isnpm run check(Node 22+, no install step) - Related docs:
CONTRIBUTING.md,site/README.md
Related: #232, #132
Filed by repo-audit/full-audit at 4adb944. Severity: medium. Effort: S. audit-key: bug|site/thumbs.mjs|sharedImageIds
- Lenguaje dominante
- JavaScript
- Estrellas
- 58
- Forks
- 15
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 TMHSDigital/Free-Game-Dev-Assets
-
enhancement good first issue priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
TMHSDigital/Free-Game-Dev-Assets#272 ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TMHSDigital/Free-Game-Dev-Assets#270 ·
Los mantenedores suelen responder en 1 día
-
documentation priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
TMHSDigital/Free-Game-Dev-Assets#269 ·
Los mantenedores suelen responder en 1 día
-
good first issue priority: low tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
TMHSDigital/Free-Game-Dev-Assets#267 ·
Los mantenedores suelen responder en 1 día
-
good first issue priority: low tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
TMHSDigital/Free-Game-Dev-Assets#266 ·
Los mantenedores suelen responder en 1 día
Todos los issues de TMHSDigital/Free-Game-Dev-Assets
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
guybedford/es-module-lexer#266 ·
-
bug documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
apify/apify-docs#3206 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
anhnt256/cursor-swarm#21 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
zerohourzulu/irontrellis#16 ·