Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(llc): add support for polls api #2040

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Conversation

xsahil03x
Copy link
Member

@xsahil03x xsahil03x commented Oct 25, 2024

This pull request introduces significant changes to the stream_chat package, primarily focused on adding support for poll-related functionalities. The most important changes include adding event listeners for poll events, implementing methods for poll operations in the StreamChatClient class, and creating a new PollsApi class to handle poll-related API calls.

Poll Events and Listeners:

  • Added several poll event listeners in the ChannelClientState class, including _listenPollUpdated, _listenPollClosed, _listenPollAnswerCasted, _listenPollVoteCasted, _listenPollVoteChanged, _listenPollAnswerRemoved, and _listenPollVoteRemoved. These listeners handle various poll-related events and update the poll messages accordingly. [1] [2]

Poll Operations in StreamChatClient:

  • Introduced methods in the StreamChatClient class to create, retrieve, update, partially update, delete, close polls, and manage poll options and votes. These methods include createPoll, getPoll, updatePoll, partialUpdatePoll, deletePoll, closePoll, createPollOption, getPollOption, updatePollOption, deletePollOption, castPollVote, addPollAnswer, removePollVote, queryPolls, and queryPollVotes.

New PollsApi Class:

  • Created a new PollsApi class to define the API operations for polls, including methods for creating, retrieving, updating, partially updating, deleting polls, managing poll options, casting and removing votes, and querying polls and poll votes.

Event Stream Mapping:

  • Modified the eventStream getter in the StreamChatClient class to map poll vote events to specific poll answer events, making it easier to handle these events in the state.

Import Statements:

  • Updated import statements to include necessary poll-related models in various files, such as client.dart and responses.dart. [1] [2]

These changes enhance the stream_chat package by adding comprehensive support for poll functionalities, including event handling, API operations, and state management.

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

Attention: Patch coverage is 50.28902% with 172 lines in your changes missing coverage. Please review.

Project coverage is 60.10%. Comparing base (aacaba6) to head (2d429da).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
packages/stream_chat/lib/src/client/channel.dart 19.81% 85 Missing ⚠️
packages/stream_chat/lib/src/core/models/poll.dart 10.00% 72 Missing ⚠️
...ges/stream_chat/lib/src/core/models/poll_vote.dart 38.88% 11 Missing ⚠️
packages/stream_chat/lib/src/client/client.dart 94.73% 2 Missing ⚠️
...s/stream_chat/lib/src/core/models/poll_option.dart 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2040      +/-   ##
==========================================
- Coverage   60.27%   60.10%   -0.18%     
==========================================
  Files         318      322       +4     
  Lines       18581    18926     +345     
==========================================
+ Hits        11200    11375     +175     
- Misses       7381     7551     +170     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@github-actions github-actions bot added Stale and removed Stale labels Nov 18, 2024
@xsahil03x xsahil03x marked this pull request as draft November 21, 2024 13:16
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