Thumbnail logo detection ignores logos already recorded in manifest.shared
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 84/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
調査の方向性
site/thumbs.mjs:311-318 の共有ロゴを移動するループと、site/lib/thumbs.mjs:162-172 の sharedImageIds を読み、その後 site/lib/lib.test.mjs にある既存の sharedImageIds テストを確認してください。ハッシュがすでに shared に存在する新しいレコードのテストを追加し、npm test を実行してください。新しいレコードが shared に移動され、テストが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- JavaScript
- スター
- 58
- フォーク
- 15
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TMHSDigital/Free-Game-Dev-Assets のほかの issue
-
enhancement good first issue priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TMHSDigital/Free-Game-Dev-Assets#272 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TMHSDigital/Free-Game-Dev-Assets#270 ·
メンテナーはふだん 1 日以内に返信
-
documentation priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TMHSDigital/Free-Game-Dev-Assets#269 ·
メンテナーはふだん 1 日以内に返信
-
good first issue priority: low tests
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
TMHSDigital/Free-Game-Dev-Assets#267 ·
メンテナーはふだん 1 日以内に返信
-
good first issue priority: low tests
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
TMHSDigital/Free-Game-Dev-Assets#266 ·
メンテナーはふだん 1 日以内に返信
TMHSDigital/Free-Game-Dev-Assets の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
guybedford/es-module-lexer#266 ·
-
bug documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
apify/apify-docs#3206 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
anhnt256/cursor-swarm#21 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
zerohourzulu/irontrellis#16 ·