[recovery] fix: guard IssuesList against GitHub issues with null user#18801
Draft
pettinarip wants to merge 1 commit into
Draft
[recovery] fix: guard IssuesList against GitHub issues with null user#18801pettinarip wants to merge 1 commit into
pettinarip wants to merge 1 commit into
Conversation
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>
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Production error
___netlify-server-handler· hit_count: 1 · request_id:01KTAFRXH3YJ525MSC7HT2VPTWRoot cause
src/components/IssuesList/index.tsxis an async server component (rendered via MDX on the public/contributingpage). It readsissue.user.login/issue.user.avatar_urlunguarded inside its synchronous.map()callback:GitHub's REST issues API returns
user: nullfor issues authored by deleted ("ghost") accounts. TheGHIssuetype declaresuseras non-null, so there is no compile-time guard. When the cached "good first issues" list contains such an issue, the SSR render dereferencesundefined.loginand the whole page render throws.The synchronous error frame
x(noasync) nested under the async render frames and the top-level___netlify-server-handlermatches 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 whereissue.useris reliably present.Fix
Filter out issues without a
userbefore rendering — a one-line null check that drops only malformed (ghost-authored) entries and leaves the existing card markup untouched.Verification
pnpm type-check— passespnpm exec eslint src/components/IssuesList/index.tsx— clean