No default cover image shown when a license for the preview image is missing #51
Labels
No labels
bug
discussion
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
edufeed/edufeed-app#51
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
i just saw this in the app:
(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?
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-89treats a cover that cannot be shown (dead host, 404, hotlink block) exactly like a cover that was never set:imageFailedstate flips on the image's error event,hasImagegoes 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.