Skip to content

fix(feedback): Make UserReport name and email nullable#116362

Merged
TkDodo merged 1 commit into
masterfrom
tkdodo/fix/user-report-nullable-name-email
May 28, 2026
Merged

fix(feedback): Make UserReport name and email nullable#116362
TkDodo merged 1 commit into
masterfrom
tkdodo/fix/user-report-nullable-name-email

Conversation

@TkDodo
Copy link
Copy Markdown
Collaborator

@TkDodo TkDodo commented May 28, 2026

The backend UserReportSerializer returns name and email as str | None, but the frontend UserReport type had both as non-nullable string. When either field is null, isSameIdentity crashes calling .trim() on null.

Updates the frontend type to match the backend and adds null-handling in userFeedback.tsx — optional chaining in isSameIdentity, null-coalescing for avatar fallbacks, and conditionally rendering the email copy button.

Fixes JAVASCRIPT-3A0C

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.59%

Comment on lines +39 to +43
onClick={() =>
copy(report.email ?? '', {
successMessage: t('Copied email to clipboard'),
})
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inlined to make it more obvious that report.email is checked above

@TkDodo TkDodo marked this pull request as ready for review May 28, 2026 09:16
@TkDodo TkDodo requested a review from a team May 28, 2026 09:27
@TkDodo TkDodo merged commit 71b7eca into master May 28, 2026
77 checks passed
@TkDodo TkDodo deleted the tkdodo/fix/user-report-nullable-name-email branch May 28, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants