No default cover image shown when a license for the preview image is missing #51

Closed
opened 2026-07-29 08:02:42 +00:00 by laoc · 1 comment
Owner
i just saw this in the app: ![image](/attachments/00d57aa4-0930-4c43-9e08-e7f10e9f4503) (https://dev.edufeed.org/naddr1qvzqqqr4hcpzq8wu0tnv994n76xc9jyw3x3hvw4qgzjff6lj9p3sv6hdesyq886fqyw8wumn8ghj7er9wchx7etjwd5juetyw4nx2ety9ehhyee0qy0hwumn8ghj7er9wchxzmtz94ex2mrp0yhx2er4vejk2epwdaexwqgmwaehxw309ajx2a3wdajhyumf9ejkgatxv4jkgtn0wfnsqftgw368qw309a3k6umnv4hxjmmjwvh8qun9wdejuurv09kk7at5dqhx2er49uplr3w5) this is a resource without a license for the cover image. i think we should default in this case to our fallback created cover image or not?
498 KiB
Author
Owner

Closing — fixed on dev @ 9d6ef9e8, with tests.

Worth recording that the diagnosis was not what the title says. The title attributes the missing cover to a missing license for the preview image. The actual cause in the reported case was that the cover URL pointed at an NXDOMAIN host — the image could not load at all. The license was a red herring.

The fix in ResourceCover.svelte:77-89 treats a cover that cannot be shown (dead host, 404, hotlink block) exactly like a cover that was never set: imageFailed state flips on the image's error event, hasImage goes false, and the generated TypoCover renders instead of a grey box. The license pill drops with the image it described, which is the correct pairing.

Covered by ResourceCover.test.js:112"ResourceCover — unloadable cover image (issue #51)" — asserting both that the fallback appears once every image stage has failed and that the license overlay goes with the broken image.

If you can still reproduce an empty cover on a resource whose image URL does resolve, that is a different bug and worth a fresh issue with the naddr.

Closing — fixed on `dev` @ `9d6ef9e8`, with tests. **Worth recording that the diagnosis was not what the title says.** The title attributes the missing cover to a missing *license* for the preview image. The actual cause in the reported case was that the cover URL pointed at an **NXDOMAIN host** — the image could not load at all. The license was a red herring. The fix in `ResourceCover.svelte:77-89` treats a cover that cannot be shown (dead host, 404, hotlink block) exactly like a cover that was never set: `imageFailed` state flips on the image's error event, `hasImage` goes false, and the generated TypoCover renders instead of a grey box. The license pill drops with the image it described, which is the correct pairing. Covered by `ResourceCover.test.js:112` — *"ResourceCover — unloadable cover image (issue #51)"* — asserting both that the fallback appears once every image stage has failed and that the license overlay goes with the broken image. If you can still reproduce an empty cover on a resource whose image URL **does** resolve, that is a different bug and worth a fresh issue with the naddr.
laoc closed this issue 2026-07-30 09:50:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
edufeed/edufeed-app#51
No description provided.