Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

thumbs: a changed `preview:` pin or source URL never refreshes the stored image, and a source that keeps failing keeps its old image forever

未关闭
#133 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
57/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
backend, data

调研方向

Start with site/lib/thumbs.mjs around needsFetch() (117–124), then read the fetch failure and prune paths in site/thumbs.mjs (218–248) and the validator note in site/checks.mjs (798–800). Run the relevant cases in lib.test.mjs and a dry run with a changed preview: pin. Done means source and pin changes trigger fetching, repeated failures eventually drop stale records and files, and each manifest source matches its entry URL.

由索引模型根据 Issue 内容生成。

描述

bug priority: medium

Why it matters

site/thumbs.json decides which publisher image the site shows. If a contributor repoints preview: at a better image, or an entry's url moves, the old picture stays on the entry page, the card and the hero filmstrip for up to 180 days. If a source starts returning 404, the old image is republished at every build with no expiry at all.

Evidence (at 69387df)

  • site/lib/thumbs.mjs:117-124 needsFetch() compares only record.license and record.fetched. Verified: a record whose source and image differ from the entry still returns false when the licence matches and fetched is recent. source, image and pinned are stored (site/thumbs.mjs:138-139) but never read back.
  • site/thumbs.mjs:218-227: on a fetch failure the old record and .webp are kept; the prune at 245-248 only removes files with no record. Nothing counts consecutive failures.
  • site/checks.mjs:798-800 says the record "is otherwise not compared with the entry", so the validator will not catch it.

Suggested approach

In needsFetch, also return true when record.source !== entry.url, when the pinned flag no longer matches whether preview: is an https:// URL, or when a pinned record's image !== entry.preview. Add a failures counter (or lastTried) to the record; after N failed runs, or when fetched is older than 2 x maxAgeDays, drop the record and file so the tile falls back to the typographic one, and report the drop in the run summary. A one-line validator check can enforce record.source === entry.url.

Done when

lib.test.mjs covers "source changed", "pin added/removed/changed" and "stale after repeated failure"; a dry run with a repointed preview: lists that entry under Fetched; the manifest's source always equals the entry's url.

主要语言
JavaScript
星标
58
派生
15
平均合并
16 小时 53 分钟
30 天内合并 PR
14

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TMHSDigital/Free-Game-Dev-Assets 的其他 Issue

查看 TMHSDigital/Free-Game-Dev-Assets 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。