Skip to content

Fix unsound return type on normalizeOpalLogo#47

Merged
ghostleek merged 2 commits intofix/show-profilefrom
copilot/sub-pr-45-again
Mar 4, 2026
Merged

Fix unsound return type on normalizeOpalLogo#47
ghostleek merged 2 commits intofix/show-profilefrom
copilot/sub-pr-45-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

normalizeOpalLogo was declared to return T, implying the output type is identical to the input — but the function mutates logoUrl, making the signature unsound for any T with a narrower logoUrl type.

Change

Return type widened to accurately reflect the mutation:

// Before
function normalizeOpalLogo<T extends { slug: string | null; logoUrl: string | null }>(app: T): T

// After
function normalizeOpalLogo<T extends { slug: string | null; logoUrl: string | null }>(app: T): Omit<T, 'logoUrl'> & { logoUrl: string | null }

This ensures downstream code sees logoUrl as string | null rather than inheriting a potentially narrower type from T.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
string-v2 Ready Ready Preview, Comment Mar 4, 2026 2:55pm

Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
Copilot AI changed the title [WIP] Work in progress to address feedback on 'Fix/show profile' PR Fix unsound return type on normalizeOpalLogo Mar 4, 2026
@ghostleek ghostleek marked this pull request as ready for review March 4, 2026 15:14
@ghostleek ghostleek merged commit 95d9137 into fix/show-profile Mar 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants