Serve a fallback for cold profile OG images
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- nextjs, typescript
- 领域
- backend
调研方向
Start at app/[username]/opengraph-image.tsx:43 to see how cachedPng is called without an onMiss, then read lib/og/pngCache.ts:93-99 for the cold-miss 404 path and the x-og-cache header values. Check app/[username]/vs/[opponent]/opengraph-image.tsx for the same pattern and look at how scripts/warm-og.mjs writes real renders so the fallback stays replaceable. Add a fallback asset such as public/og-root.png plus a route test covering cold miss, fallback and warmed hit; done means a never-warmed valid profile returns 200 PNG bytes with x-og-cache: fallback.
由索引模型根据 Issue 内容生成。
描述
Current behavior
A profile with no warmed OG PNG returns 404 from /<login>/opengraph-image. X, Slack, Telegram and other unfurlers then show a blank or text-only card on the first share.
Live probes:
torvalds/opengraph-image 200 x-og-cache: r2-hit
defunkt/opengraph-image 404 x-og-cache: miss-empty
octocat/opengraph-image 404 x-og-cache: miss-empty
Cause
app/[username]/opengraph-image.tsx:43 calls cachedPng without an onMiss callback. lib/og/pngCache.ts:93-99 treats a cold miss as 404 with no-store. scripts/warm-og.mjs fills only handles that are already in the local warm set, and app/api/og/[username]/route.tsx is restricted to a local force flag.
Expected behavior
A valid profile should never return a blank OG response. Serve a branded fallback PNG on a cold miss, for example the existing public/og-root.png or a card-shaped fallback, with x-og-cache: fallback and normal public cache headers. Schedule or request a real render separately; do not do a Satori render on the request path.
Scope
app/[username]/opengraph-image.tsxapp/[username]/vs/[opponent]/opengraph-image.tsxif it shares the pathlib/og/pngCache.tsfor an explicit fallback path- a fallback asset and a route test
Acceptance
- A valid profile that has never been warmed returns
200with PNG bytes, not404. - The response identifies the fallback with
x-og-cache. - A later warm still replaces the fallback through the normal cache path.
- A test covers cold miss, fallback and warmed hit.
- 主要语言
- TypeScript
- 星标
- 7
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
LangerSword/gitone 的其他 Issue
-
bug help wanted
难度 2/5 1-3 小时 新手友好度 80/100
LangerSword/gitone#7 ·
-
accessibility bug help wanted
难度 2/5 1-3 小时 新手友好度 78/100
LangerSword/gitone#6 ·
-
bug help wanted
难度 3/5 1-2 天 新手友好度 72/100
LangerSword/gitone#5 ·
-
bug help wanted security
难度 4/5 3-5 天 新手友好度 35/100
LangerSword/gitone#3 ·
-
Add a /health endpoint可能已有人在做 @LangerSword 今天认领。 未关闭good first issue
难度 1/5 1-3 小时 新手友好度 45/100
LangerSword/gitone#2 · 1 条评论 ·
查看 LangerSword/gitone 的全部 Issue
相似的 Issue
-
MCP tool results drop structuredContent when text is only a summary可能已有人在做 @Pankaj-bit361 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
inblockio/siwx-oidc-matrix-server#101 ·
维护者通常 1 天内回复
-
status:needs-triage
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
pingdotgg/t3code#42253 · 1 条评论 ·
维护者通常 1 天内回复