Find logo: why each image failed is collected and never shown, and the favicon fallback is often cut off #526
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#526
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?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, readingfind_on_website.Related to #21.
Checked again on 2026-10-01 against
mainat0a5cad587: still present.jobs/logos.pyhas not changed.find_on_websitekeeps each candidate'sUnusableLogomessage in a list calledproblemsand never reads it, so a person who presses Find logo is told only that nothing could be used, never why. The same function appends/favicon.icoas the last resort and then tries only the first six candidates, so on any page that declares six or more icons the fallback is never tried.jobs/logos.py:321-335(find_on_website):candidates.append(urljoin(base, "/favicon.ico"))at 321,problems = []at 323,for candidate in candidates[:6]:at 324,problems.append(str(error))at 329, and the finalUnusableLogoat 332-335, which does not useproblems. The candidates come from_LogoLinks.candidates(jobs/logos.py:247-256): every declaredapple-touch-icon, then everyicon, then the organisation's JSON-LD logo, thenog:image.MAX_BYTES, gives the errand the message "Nothing on example.com could be used as a logo." The reasonsdownloadandprocessproduced ("The address answered 403.", "That file is larger than a logo should be.") are thrown away, and nothing is logged. A site that declares sevenapple-touch-iconsizes, which is common, has its favicon dropped from the list, although it may be the one image that would have worked.info. Cut the declared candidates to five before appending/favicon.ico, so the fallback is always the sixth try.Done when
tests/test_logos.py, besidetest_a_site_with_nothing_usable_says_so: a site whose only icon answers 403 yields a message that names the 403; and a page declaring seven icons that all fail still has/favicon.icofetched. Both fail today.