GeezerVison is showing github.com — fix(server): resolve percent-encoded local favicon hrefs by only21mil · Pull Request #42314 · pingdotgg/t3code
Conversation
Problem
ProjectFaviconResolver reads <link rel="icon" href="..."> from index.html (and similar sources), strips the leading /, and stats the path still percent-encoded. A local href like href="/team%20mark.svg" never matches public/team mark.svg (the file a browser loads for that URL), so the project shows a monogram instead of its icon.
Reproduced on Linux, Node v26.13.1, base f99ef08bb8d.
Change
- Decode local favicon hrefs in
apps/server/src/project/ProjectFaviconResolver.ts (resolveIconHref) with the existing safeDecodeURIComponent helper from @t3tools/shared/markdownLinks. Malformed escapes like /100%.svg keep their raw text and resolve as before. A decoded NUL (%00) is skipped, since stat rejects it with an error rather than a miss. Decoded candidates still go through the existing workspace containment check, blocking %2e%2e traversal outside the project.
- Extend existing unit tests in
apps/server/src/project/ProjectFaviconResolver.test.ts: add percent-encoded (/team%20mark.svg) and malformed (/100%.svg) href checks plus a /a%00b.svg link in the existing list of "resolves icon hrefs from project source files", and update "skips icon metadata paths outside the workspace" to place real outside.svg files one and two levels up and check both a raw (../../outside.svg) and a percent-encoded (/%2e%2e%2f%2e%2e%2foutside.svg) link.
Scope
Small fix of an obvious local favicon resolution bug, so no issue is needed.
Verification
An AI agent ran all checks below.
Setup: Linux, Chromium web client, light theme, 1280x800, fresh isolated server data on each commit, a sample project whose index.html has <link rel="icon" href="/team%20mark.svg"> and a public/team mark.svg file, server named "Test machine".
Steps: add the sample project -> open the web app -> look at the project icon next to Team site in the thread header.
- Resolver run on
f99ef08bb8d vs 5dc5e0e8eab (Node v26.13.1): encoded (/team%20mark.svg, public/team mark.svg) returned null (monogram) on f99ef08bb8d and encoded/ws/public/team mark.svg on 5dc5e0e8eab; control (/team-mark.svg, public/team-mark.svg) resolved to control/ws/public/team-mark.svg and malformed (/100%.svg, public/100%.svg) resolved to malformed/ws/public/100%.svg on both; traversal (/%2e%2e/%2e%2e/outside.svg with ../outside.svg outside workspace) and NUL (/a%00b.svg) returned null (monogram) on both.
- Regression test (
apps/server/src/project/ProjectFaviconResolver.test.ts): fails on base f99ef08bb8d (1 failed | 14 passed (15)); passes 3 of 3 runs on 5dc5e0e8eab (15 passed (15)).
- NUL-guard check: removing the NUL guard fails
ProjectFaviconResolver.test.ts (1 failed | 14 passed (15)) with ProjectFaviconResolutionError during stat-candidate.
vp run check:changed: exit 0 (format, lint, knip 1/2, knip 2/2, graphql (apps/server), typecheck (3 packages), test (2 files); unused patch check skipped with no dependency files changed).
Not shown: desktop and mobile were not run separately; they show the same server-resolved icon.
Generated with Gemini 4 Neon in T3 Code Nightly
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Important
Review skipped
Review was skipped as selected files did not have any reviewable changes.
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 5dc5e0e and 52b5eab.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review.
Walkthrough
-
The favicon resolver now decodes percent-encoded hrefs before file lookup and rejects decoded paths containing NUL. Tests cover encoded and malformed hrefs, NUL values, and traversal paths outside the workspace.
Changes: Favicon href resolution
| Layer / File(s) |
Summary |
Normalize and validate favicon hrefs apps/server/src/project/ProjectFaviconResolver.ts, apps/server/src/project/ProjectFaviconResolver.test.ts |
The resolver decodes hrefs after trimming whitespace and removing one leading slash. It returns no candidates when the decoded path contains NUL. Tests cover encoded spaces, malformed percent encoding, NUL hrefs, and traversal paths. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Possibly related PRs
- pingdotgg/t3code#42023: Changes href selection and candidate-path error handling in
ProjectFaviconResolver, which uses the candidate flow that receives decoded hrefs here.
- pingdotgg/t3code#42082: Strips query strings and fragments from favicon URLs before lookup; this normalization interacts with percent-decoding in this change.
Suggested reviewers: geezoria, macroscopeapp
Merge Risk: Minimal · previous review 5dc5e
-
Percent-encoded local favicon links such as team%20mark.svg now resolve to the matching file. Malformed escapes and traversal attempts keep their existing safe handling. No actionable merge risk remains.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title "fix(server): resolve percent-encoded local favicon hrefs" names the main change: local favicon hrefs are now percent-decoded before file lookup in ProjectFaviconResolver. It follows convent… |
| Description check |
 |
The description follows the template. It has Problem, Change, Scope, and Verification sections. Problem gives the bug, reproduction environment, and expected behavior. Change names the function, the r… |
| 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 "fix(server): resolve percent-encoded local favicon hrefs" names the main change: local favicon hrefs are now percent-decoded before file lookup in ProjectFaviconResolver. It follows conventional commit format and matches the raw summary, the objectives, and the description.
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. Problem gives the bug, reproduction environment, and expected behavior. Change names the function, the reused helper, the NUL guard, and the containment check. Scope explains why no issue is linked and says it is a small obvious fix. Verification lists focused regression tests, a NUL-guard check, a passing check:changed run, and before/after screenshots, and it states what was not run (desktop and mobile). The template's PR-title line is a comment and is not required. The description does not link the issue or maintainer request, but the author gives a reason, which the template allows.
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 aaadc0c and 5dc5e0e.
Files selected for processing: 2
-
apps/server/src/project/ProjectFaviconResolver.test.ts
apps/server/src/project/ProjectFaviconResolver.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Evidence
Linux Chromium, 1280×800, light theme, fresh isolated databases, Replay (dev). Seed Team site with <link rel="icon" href="/team%20mark.svg"> and public/team mark.svg; seed Control site with the same SVG under an unencoded href. Open the control thread, then Team site's thread and inspect its breadcrumb icon.
Proven: the identical scenario fails on base and passes on head. Base shows the TS monogram; head shows the SVG. Control site displays its SVG on both sides.
Scenario source
Not shown:
- Malformed percent escapes, decoded NUL rejection, and decoded workspace traversal containment were not exercised in the real app; this scenario covers the reported percent-encoded space filename.
|
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.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 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.
|