GeezerVison is showing github.com — fix(server): resolve a later local project favicon when an earlier icon link is not a local file by only21mil · Pull Request #42023 · pingdotgg/t3code
Conversation
Problem
When a project's index.html or root route file lists a data: icon, an https: icon, or a missing file before a local icon such as <link rel="icon" href="/brand/logo.svg">, the project shows its letter monogram instead of that icon. The resolver tried only the first icon href. A long base64 data: icon also made stat fail with ENAMETOOLONG, which errored the whole lookup.
Change
The resolver now collects every icon href in document order (HTML <link> tags first, then route object literals, as before) and uses the first one that names an existing file in the workspace, so an earlier existing icon still wins. Hrefs with a URL scheme (data:, https:) or a protocol-relative //host are skipped, since they never name a project file. A path that runs through a file (ENOTDIR) or a symlink loop now counts as missing, as NotFound already did, whether it is a candidate, a source file, or a cached icon checked again. That applies to every favicon candidate, not just source hrefs.
Scope
A small fix for an obvious server bug in ProjectFaviconResolver.ts, so it has no issue. No client or contract changes.
Verification
Setup: Linux, web client in T3 Code's Browser panel at 1280×800, light theme, a fresh dev server process (vp run dev --no-seed) and browser origin for each commit, server labelled "Test machine". The Brand Demo fixture's index.html lists a percent-encoded data: SVG icon, an https: icon, then /brand/logo.svg, with public/brand/logo.svg present and no favicon.* file.
Steps: add the fixture project → start a Replay (dev) thread in it → open the thread.
c9e22e5ff42 (main) |
ae84e41b005 (this PR) |
 |
 |
| Brand Demo shows its letter monogram in the sidebar and breadcrumb. |
Brand Demo shows its own logo.svg in the sidebar and breadcrumb. |
An AI agent ran vp test run src/project/ProjectFaviconResolver.test.ts. The updated cases fail on c9e22e5ff42 (the HTML case with ENAMETOOLONG, the route case finds no icon) and pass 3 of 3 runs on ae84e41b005. They also pass on a local merge with main at a891304c84b, which merges cleanly and leaves both changed files identical. vp run check:changed passes.
What the tests cover
- An
index.html listing a 5,000-character base64 data: icon, an https: icon, a missing file, a //host icon that matches a local file, and a path through a file, then /brand/logo.svg and a later existing /brand/late.svg. It resolves logo.svg. When public then becomes a file, the next lookup falls back to web/favicon.png instead of failing.
- A route literal with an
https: icon before a local one.
- A root-relative
/brand:v2.svg, which stays a path (skipped on Windows, where : is not allowed in file names).
- The tests fail if the scheme check, the
// check or the ENOTDIR skip for a candidate, a source file or a cached icon is removed, if either href list stops at its first entry, if candidates are tried in reverse, or if the scheme check runs after the leading / is stripped.
Links
Not shown
- The
ENAMETOOLONG error from a long base64 data: icon is shown by the test only.
- Desktop and mobile clients load the same server-resolved icon.
Generated with Claude Opus 5.5 in T3 Code Nightly
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…on link is not a local file
coderabbitai
Bot
commented
Nov 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The favicon resolver now checks multiple icon hrefs in order, ignores external URLs, and treats BadResource errors as missing resources. Tests cover icon selection, cached-path fallback, and route-metadata resolution.
Changes: Favicon Resolution
| Layer / File(s) |
Summary |
Ordered icon resolution and missing-resource handling apps/server/src/project/ProjectFaviconResolver.ts, apps/server/src/project/ProjectFaviconResolver.test.ts |
The resolver extracts icon hrefs and checks local candidates in order while skipping external and protocol-relative URLs. It treats BadResource errors during candidate lookup, source access, and cached-path validation as missing resources. Tests cover candidate selection, fallback, and route metadata. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge, bramley-jetcharge
Merge Risk: Minimal · up to f4ebe
-
This fixes favicon selection so that a later local icon is used when an earlier icon link is not a local file. No concrete merge-blocking risk remains.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: the resolver now picks a later local favicon when an earlier icon link is not a local file. It matches the objectives and the raw summary, which describe collecting ev… |
| Description check |
 |
The description follows the template. It has Problem, Change, Scope, and Verification sections, and each one has real content. The Verification section lists the tests, the before and after comparison… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the main change: the resolver now picks a later local favicon when an earlier icon link is not a local file. It matches the objectives and the raw summary, which describe collecting every icon href and skipping URL-scheme hrefs.
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections, and each one has real content. The Verification section lists the tests, the before and after comparison, the commit hashes, and the checks that were run. The author also states what was not shown. The template comment asks for a model and harness line, and the description includes one (Claude Opus 5.5 in T3 Code Nightly).
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between ae84e41 and f4ebe39.
Files selected for processing: 2
-
apps/server/src/project/ProjectFaviconResolver.test.ts
apps/server/src/project/ProjectFaviconResolver.ts
Files with no reviewable changes: 1
-
- apps/server/src/project/ProjectFaviconResolver.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Keeps the exported optionOnNotFound unchanged for AssetAccess and drops a
colon-path test the scheme check could not break.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 24, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:M
30-99 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|