Skip to content

Conversation

@mogita
Copy link
Contributor

@mogita mogita commented Dec 17, 2025

The PollVote.user type was missing the image field, even though the data was present in WebSocket/API responses. This caused TypeScript to not recognize user.image as a valid property.

Changes:

  • Replaced PollVote import with PollVoteResponseData
  • Removed Poll as PollType import (now using PollResponseData directly)
  • Updated PollState type to use Omit<PollResponseData, ...>
  • Removed @ts-expect-error directives that are no longer needed

Type Improvements:

Before After
user?: User (no image) user?: UserResponse (has image)
teams_role: required teams_role?: optional

None breaking changes found.

Copilot AI review requested due to automatic review settings December 17, 2025 07:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes TypeScript typing issues for Poll and PollVote data structures by using the correct response data types (PollVoteResponseData and PollResponseData) instead of the base types (PollVote and Poll). The key improvement is that PollVoteResponseData uses UserResponse which includes the image field and makes teams_role optional, matching the actual API/WebSocket response data structure.

Key Changes:

  • Replaced all PollVote type references with PollVoteResponseData
  • Replaced all Poll/PollType type references with PollResponseData
  • Removed 18 @ts-expect-error directives that suppressed the type incompatibility errors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@szuperaz szuperaz merged commit 6d83e88 into main Dec 17, 2025
3 checks passed
@szuperaz szuperaz deleted the fix/poll-user-response branch December 17, 2025 08:19
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.

image missing in PollVote.user

3 participants