Commit 1833d92
committed
fix(favicon): resolve metadata at request time, fully honor whitelabel favicon
Addresses the second round of review findings on PR #5588:
- Cursor (High): app/layout.tsx exported a static `export const metadata =
generateBrandedMetadata()`. Next.js treats a static metadata object as
truly constant (eligible for build-time resolution on any
statically-rendered route sharing the layout), so it doesn't know this
one secretly depends on process.env via getDeploymentEnv() - same
bake-in risk already fixed for next.config.ts. Converted to
generateMetadata(), the documented way to force per-request resolution.
- Greptile (P1): the earlier whitelabel fallback fixed the *tint* but not
the underlying precedence gap - Sim's exact-size PNG/apple entries were
still emitted alongside the tenant's generic sizes:'any' entry, and
browsers can prefer the more specific size match. Now the tenant
favicon fully replaces every icon slot instead of being appended
alongside Sim's.
- Cursor (Medium): app/api/favicon/route.ts never checked
brand.faviconUrl, so a whitelabeled dev/staging deployment still served
Sim's tinted icon at the legacy /favicon.ico path. Now checks
brand.faviconUrl first, matching generateBrandedMetadata()'s
precedence.1 parent 944c5e4 commit 1833d92
3 files changed
Lines changed: 36 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | | - | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
159 | 158 | | |
160 | 159 | | |
161 | 160 | | |
| |||
0 commit comments