Skip to content

[recovery] fix: guard IssuesList against GitHub issues with null user#18801

Draft
pettinarip wants to merge 1 commit into
devfrom
recovery/fix/issueslist-null-user
Draft

[recovery] fix: guard IssuesList against GitHub issues with null user#18801
pettinarip wants to merge 1 commit into
devfrom
recovery/fix/issueslist-null-user

Conversation

@pettinarip

Copy link
Copy Markdown
Member

Production error

TypeError: Cannot read properties of undefined (reading 'login')
  at x (.next/server/chunks/[root-of-the-server]__0jap1v0._.js:2:7061)
  at async l (…:2:10929)
  at async s (…:2:11970)
  at async Module._ [as handler] (…:2:13040)
  • Function: ___netlify-server-handler · hit_count: 1 · request_id: 01KTAFRXH3YJ525MSC7HT2VPTW
  • URL: none captured

Root cause

src/components/IssuesList/index.tsx is an async server component (rendered via MDX on the public /contributing page). It reads issue.user.login/issue.user.avatar_url unguarded inside its synchronous .map() callback:

{issues.map((issue) => (
  <Avatar name={issue.user.login} href={`https://github.com/${issue.user.login}`}  />

GitHub's REST issues API returns user: null for issues authored by deleted ("ghost") accounts. The GHIssue type declares user as non-null, so there is no compile-time guard. When the cached "good first issues" list contains such an issue, the SSR render dereferences undefined.login and the whole page render throws.

The synchronous error frame x (no async) nested under the async render frames and the top-level ___netlify-server-handler matches this synchronous .map() callback rather than the webhook's async POST body (app/api/gfi-issues-webhook/route.ts), which shares the same field access but reads a webhook payload where issue.user is reliably present.

Fix

Filter out issues without a user before rendering — a one-line null check that drops only malformed (ghost-authored) entries and leaves the existing card markup untouched.

Verification

  • pnpm type-check — passes
  • pnpm exec eslint src/components/IssuesList/index.tsx — clean

GitHub's REST issues API returns `user: null` for issues authored by
deleted ("ghost") accounts. IssuesList renders on the public
/contributing page and read `issue.user.login` unguarded inside its
`.map()` callback, so a single such issue in the cached GFI list crashed
the SSR render with "Cannot read properties of undefined (reading
'login')". Filter out issues without a user before rendering.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pettinarip pettinarip added the recovery-agent Created by the Recovery Agent label Jul 14, 2026
@netlify

netlify Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit ad78acf
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/6a568890effb930008586a35
😎 Deploy Preview https://deploy-preview-18801.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 60 (🟢 up 4 from production)
Accessibility: 95 (no change from production)
Best Practices: 100 (no change from production)
SEO: 98 (no change from production)
PWA: 59 (🔴 down 1 from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

recovery-agent Created by the Recovery Agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant