Commit 37a3b05
committed
fix(favicon): close static/ISR bake-in gap, fix manifest whitelabel leak
Addresses the third round of review findings on PR #5588:
- Cursor (Medium): generateMetadata() alone does not force per-request
evaluation - only the overall page being dynamic does, and a plain
process.env read is not a Next.js "dynamic signal" Next can detect.
Verified this doesn't matter for any route TODAY (0 of 1007 real page
routes are static/ISR-eligible - only non-HTML RSS/sitemap/robots/OG
files are), but it was a latent gap: any future static or ISR page
added under the root layout would silently get build-time
(production-tier) favicon metadata baked in, with no error. Added
`export const dynamic = 'force-dynamic'` to app/layout.tsx, matching
the same declaration already on app/manifest.ts and
app/api/favicon/route.ts. Verified via full build that the 9
legitimately-static routes (RSS/sitemap/robots/OG-image files, which
don't render through the root layout's page tree) are unaffected -
same count, same routes, before and after.
- Greptile (P1, reported as two separate threads): app/manifest.ts
(PWA install/home-screen icons) never checked brand.faviconUrl at
all, so a whitelabeled deployment would still show Sim's icon when
installed even after the HTML favicon was fixed. Now uses
brand.faviconUrl when set, same precedence as
generateBrandedMetadata().
- Cursor (Low): the `brand.faviconUrl ? 'production' : getDeploymentEnv()`
ternary computed a value never actually read when brand.faviconUrl is
set (every consumer already short-circuits on brand.faviconUrl
first). Simplified to always resolve the environment tier.1 parent 5412f70 commit 37a3b05
3 files changed
Lines changed: 45 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
27 | 43 | | |
28 | 44 | | |
29 | 45 | | |
| |||
32 | 48 | | |
33 | 49 | | |
34 | 50 | | |
35 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
36 | 54 | | |
37 | 55 | | |
38 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
0 commit comments